LakshSingla commented on code in PR #12770:
URL: https://github.com/apache/druid/pull/12770#discussion_r928781485
##########
sql/src/main/java/org/apache/druid/sql/calcite/table/DruidTable.java:
##########
@@ -106,7 +106,10 @@ 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
Review Comment:
Yes, I think so. This is because this change is required for the Calcite
layer. The two use cases that I am thinking of right now:
1. Let's say we have a function FUNC(a) that accepts long. If the user
passes a `__time` column of type long, this would be typecasted to
SqlTypeName.TIMESTAMP before passing to FUNC(a). This will cause a signature
mismatch, even though the query would have produced correct results downstream.
2. In the future, when the typecasting with the cursor is improved to accept
columns of type other than LONG, this would ensure that the explicit type
passed by the user is respected.
--
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]