Github user kaspersorensen commented on a diff in the pull request:
https://github.com/apache/metamodel/pull/124#discussion_r75043572
--- Diff:
jdbc/src/main/java/org/apache/metamodel/jdbc/dialects/SQLServerQueryRewriter.java
---
@@ -116,6 +116,14 @@ public String rewriteFilterItem(FilterItem item) {
final String dateTimeValue = "CAST('" +
format.format(date) + "' AS DATETIME)";
sb.append(dateTimeValue);
+
+ //Remove TIMESTAMP token as SQL Server doesn't support it
+ int timestampIndex = sb.lastIndexOf("TIMESTAMP");
--- End diff --
But that info would then also suggest that this fix is wrong because a few
lines up (line 105) it says `if (operand instanceof Date) {`and I guess that is
NOT the case when the operand is a string.
The point of this PR should at least be proven with a unittest because
right now I think it doesn't actually fix the problem, and it also does not
prove that a problem exist (I believe that it exist, I just don't think it is
in these particular lines of code).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---