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_r256862657
##########
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:
I'm not exactly sure what you sent me. The problem I'm trying to fix is
`{
"type": "expression",
"name": "vc",
"expression":
"timestamp_parse(timestamp_format(\"__time\",'yyyy-MM-dd\\u0027T\\u0027HH:mm:ss.SSS\\u0027Z\\u0027','America/New_York'),'','UTC')",
"outputType": "LONG"
}`
Where the column __time is is incorrectly formatted as \"__time\". I've
issued the json myself with the escaped double quotes and it does not work,
which is what prompted the change.
The Druid docs say
> Expressions can contain variables. Variable names may contain letters,
digits, '_' and '$'. Variable names must not begin with a digit. **To escape
other special characters, you can quote it with double quotation marks.**
The expression call is already inside a json string. So I'm not sure it
needs escape characters
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services