hsuan-yi chu <> in drill

DRILL-4577: Construct a specific path for querying all the tables from a hive database

DRILL-4529: Force $SUM0 to be used when Window Sum is supposed to returned non-nullable type

DRILL-4525: Allow SqlBetweenOperator to accept LOWER_OPERAND and UPPER_OPERAND with different types

Bump calcite version to 1.4.0-drill-r11

DRILL-4372: (continued) Support for Window functions: - CUME_DIST - DENSE_RANK - PERCENT_RANK - RANK - ROW_NUMBER - NTILE - LEAD - LAG - FIRST_VALUE - LAST_VALUE

  1. … 11 more files in changeset.
DRILL-4490: Ensure the count generated by ConvertCountToDirectScan is non-nullable

DRILL-4372: (continued) Add option to disable/enable function output type inference

DRILL-4476: Allow UnionAllRecordBatch to manager situations where left input side or both sides come(s) from empty source(s).

close apache/drill#407

DRILL-4372: Expose the functions return type to Drill

- Drill-Calite version update:

This commit needs to have Calcite's patch (CALCITE-1062) to plugin customized SqlOperator.

- FunctionTemplate

Add FunctionArgumentNumber annotation. This annotation element tells if the number of argument(s) is fixed or arbitrary (e.g., String concatenation function).

Due to this modification, there are some minor changes in DrillFuncHolder, DrillFunctionRegistry and FunctionAttributes.

- Checker

Add a new Checker (which Calcite uses to validate the legitimacy of the number of argument(s) for a function) to allow functions with arbitrary arguments to pass Caclite's validation

- Type conversion between Drill and Calcite

DrillConstExector is given a static method getDrillTypeFromCalcite() to convert Calcite types to Drill's.

- Extract function's return type inference

Unlike other functions, Extract function's return type can be determined solely based on the first argument. A logic is added in to allow this inference to happen

- DrillCalcite wrapper:

From the aspects of return type inference and argument type checks, Calcite's mechanism is very different from Drill's. In addition, currently, there is no straightforward way for Drill to plug-in customized mechanisms to Calcite. Thus, wrappers are provided to serve the objective.

Except for the mechanisms of type inference and argument type checks, these wrappers just forward any method calls to the wrapped SqlOpertor, SqlFuncion or SqlAggFunction to respond.

A interface DrillCalciteSqlWrapper is also added for the callers of the three wrappers to get the wrapped objects easier.

Due to these wrappers, UnsupportedOperatorsVisitor is modified in a minor manner.

- Calcite's SqlOpertor, SqlFuncion or SqlAggFunction are wrapped in DrillOperatorTable

Instead of returning Caclite's native SqlOpertor, SqlFuncion or SqlAggFunction, return the wrapped ones to ensure customized behaviors can be adopted.

- Type inference mechanism

This mechanism is used across all SqlOpertor, SqlFuncion or SqlAggFunction. Thus, it is factored out as its own method in TypeInferenceUtils

- Upgrade Drill-Calcite

Bump version number to 1.4.0-drill-test-r16

- Implement two argument version of lpad, rpad

- Implement one argument version of ltrim, rtrim, btrim

  1. … 23 more files in changeset.
DRILL-4372: (continued) Type inference for HiveUDFs

DRILL-4323: Handle skipAll query when use HiveDrillNativeParquetScan

Do not add Project when no column is needed to be read out from Scan (e.g., select count(*) from hive.table)

DRILL-4314: Unit Test Framework can support schema check

Closes #339

DRILL-4180: When clear() is called on BitVector, ensure valueCount is set to zero

DRILL:3854: Ensure the readIndex of DrillBuf[] returned by ValueVector.getBuffers points at 0

DRILL-4083: ScanPrel's CPU cost should not be zero even if column count is zero

close apache/drill#253

DRILL-4006: Reallocate offset vector in repeated vectors when index is beyond the current capacity

Author: Steven Phillips <>

This closes #243, #242

DRILL-3943: In constant folding, when the the data type of the return value is TimeStamp, generate TimeStamp Literal

This closes #206

DRILL-3769: Allow to_date() to use castDate()'s implementations

DRILL-3257: Disable FilterSetOpTransposeRule, DrillProjectSetOpTransposeRule and add test cases

Close apache/drill#176

DRILL-3280, DRILL-3360, DRILL-3601, DRILL-3649: Add test cases

Fix is in CALCITE-820

Close apache/drill#152

DRILL-3580: Add test case and bump calcite version to 1.4.0-drill-r2

Fix is in CALCITE-841

DRILL-3755: In DrillSqlWorker, give UserException.validationError if ValidationException is thrown from Calcite

DRILL-3719: Expand -expression as -1 * expression in visitCall of DrillOptiq

DRILL-3718: After TextReader finishes reading a field surrounded by double quotes, the reader would skip whitespaces only if those whitespaces are not used as delimiter

    • -0
    • +3
    • -0
    • +3
    • -0
    • +3
DRILL-3683: Add baseline and expected plan for TestWindowFunctions suite

DRILL-3412: Add ProjectWindowTransposeRule to push Project past Window

Fix is in CALCITE-844

DRILL-3657: When constants are referred in Window Prel, ensure the indices are shifted properly

DRILL-3574: (continued) Code refactoring to use DrillDistributionTrait constructor that allows SINGLETON

DRILL-3574: For the empty Over-Clause, make DrillDistributionTrait to be as SINGLETON