You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/07/22 15:33:40 UTC

[GitHub] [druid] cryptoe commented on a diff in pull request #12770: Type of __time column is determined by RowSignature in case of External Datasource

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 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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org