Wenzhe Zhou has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/21015 )

Change subject: IMPALA-12815: Support timestamp for scan predicates for 
external data source table.
......................................................................


Patch Set 4:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/21015/4/fe/src/main/java/org/apache/impala/planner/DataSourceScanNode.java
File fe/src/main/java/org/apache/impala/planner/DataSourceScanNode.java:

http://gerrit.cloudera.org:8080/#/c/21015/4/fe/src/main/java/org/apache/impala/planner/DataSourceScanNode.java@148
PS4, Line 148:         return new TColumnValue().setString_val(
> We should probably just call the setTimestamp_val() and not set the string
timestamp_val is defined as 16 byte binary array. When calling 
setTimestamp_val(), we should call getValue, e.g.
  return new TColumnValue().setTimestamp_val(
      ((TimestampLiteral) expr).getValue());
In jdbc function QueryConditionUtil.getTColumnValueAsString(), we need to 
convert byte array to string.
The byte array structure is defined in backend code 
be/src/runtime/timestamp-value.h, including 8 bytes for the nanoseconds within 
the current day and 4 -bytes for the date as a day. We can use nanoseconds and 
date to create a java.sql.Timestamp object, then use SimpleDateFormat to 
generate timestamp string.
When using setString_val, we don't need to convert Timestamp value to string. 
This assume the external SQL databases have exact same string format for 
timestamp as Impala. Can we make such assumption?



--
To view, visit http://gerrit.cloudera.org:8080/21015
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If6ffe672b4027e2cee094cec4f99b9df9308e441
Gerrit-Change-Number: 21015
Gerrit-PatchSet: 4
Gerrit-Owner: gaurav singh <[email protected]>
Gerrit-Reviewer: Abhishek Rawat <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Wenzhe Zhou <[email protected]>
Gerrit-Reviewer: gaurav singh <[email protected]>
Gerrit-Comment-Date: Thu, 15 Feb 2024 13:31:10 +0000
Gerrit-HasComments: Yes

Reply via email to