cryptoe commented on code in PR #12770:
URL: https://github.com/apache/druid/pull/12770#discussion_r927768986


##########
sql/src/main/java/org/apache/druid/sql/calcite/table/DruidTable.java:
##########
@@ -106,7 +106,12 @@ public Statistic getStatistic()
   @Override
   public RelDataType getRowType(final RelDataTypeFactory typeFactory)
   {
-    return RowSignatures.toRelDataType(rowSignature, typeFactory);
+    // For external datasources, the row type should be determined by whatever 
the row signature has been explicitly
+    // passed in. Typecasting directly to SqlTypeName.TIMESTAMP will lead to 
inconsistencies with the Calcite functions
+    // For example, TIME_PARSE(__time) where __time is specified to be a 
string field in the external datasource
+    // would lead to an exception because __time would be interpreted as 
timestamp if we typecast it.
+    boolean typecastTimeColumn = !(dataSource instanceof ExternalDataSource);

Review Comment:
   @LakshSingla I guess we can remove the force typecasting after the long 
check no ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to