ihuzenko commented on a change in pull request #1940: DRILL-7406: Update 
Calcite to 1.21.0
URL: https://github.com/apache/drill/pull/1940#discussion_r362056288
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/DrillConvertletTable.java
 ##########
 @@ -138,14 +105,209 @@ public SqlRexConvertlet get(SqlCall call) {
       ((SqlBasicCall) call).setOperator(wrapper);
       return sqlRexConvertlet;
     }
-
-    if ((convertlet = map.get(call.getOperator())) != null) {
+    if ((convertlet = operatorToConvertletMap.get(call.getOperator())) != 
null) {
       return convertlet;
     }
-
     return StandardConvertletTable.INSTANCE.get(call);
   }
 
-  private DrillConvertletTable() {
+  /**
+   * Custom convertlet to handle extract functions. Optiq rewrites
+   * extract functions as divide and modulo functions, based on the
+   * data type. We cannot do that in Drill since we don't know the data type
+   * till we start scanning. So we don't rewrite extract and treat it as
+   * a regular function.
+   */
+  private SqlRexConvertlet extract() {
 
 Review comment:
   I agree that static missed here but I would like to leave naming as is. The 
name is short and the return type is clear.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to