jszeluga commented on a change in pull request #1014: [CALCITE-2804] fix 
casting to timestamps because of malformed dimensi…
URL: https://github.com/apache/calcite/pull/1014#discussion_r256930157
 
 

 ##########
 File path: 
druid/src/main/java/org/apache/calcite/adapter/druid/DruidExpressions.java
 ##########
 @@ -159,7 +159,7 @@ public static String toDruidExpression(
   }
 
   public static String fromColumn(String columnName) {
-    return DruidQuery.format("\"%s\"", columnName);
+    return DruidQuery.format("%s", columnName);
 
 Review comment:
   ~~The issue is that it isn't `__time` vs `"__time"` it's `__time`  vs 
`\"__time\"` it is literally writing the backslashes into the expression call. 
Remember that the expression itself is written inside quotes~~
   
   ~~`{"expression":"timestamp_format(__time, 'yyyy-MM-dd', 
'America/New_York')"}`~~
   
   ~~Per the [Druid 
documentation](http://druid.io/docs/latest/misc/math-expr.html) Single quotes 
are for String literals, which is what is used for the date format and 
timezone. It says to use double quotes to escape special characters, which I 
think this is what we are talking about, but I don't know if that applies to 
column names. The issue I found with the escaped double quotes was that it was 
being applied to the column name and putting in the backslash into the json 
string. So of course Druid couldn't find a column named `\"__time\"` it doesn't 
exist~~
   
   Ok I just did a test and the backslashes aren't the problem. You are right. 
The issue was that the timestamp format wasn't provided (which I also fixed). 
I'll change the pull request and update the Jira case

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to