[
https://issues.apache.org/jira/browse/DRILL-4525?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15210532#comment-15210532
]
ASF GitHub Bot commented on DRILL-4525:
---------------------------------------
Github user hsuanyi commented on the pull request:
https://github.com/apache/drill/pull/439#issuecomment-200919168
In addition to @jinfengni's point:
@sudheeshkatkam did a proposal to add a new SqlAvgAggFunction (the
inference mechanism of the original is not ideal for Drill). It was declined by
Calcite's community, and the argument was adding unnecessary duplicates to the
code. I think this argument is fair. Otherwise, there might be tens of variants
for a single operator.
Regarding adding a new converlet:
Initially, I though having three wrappers (operator, function, agg
function) are sufficient for all scenarios. However, at one method during
conversion, the type SqlBetweenOperator is being expected. Thus, I decided to
add a new wrapper which extends SqlBetweenOperator, so we do not need to do
anything in conversion.
Certainly, we might be able to attain by not adding a new wrapper but
adding a new converlet. I would not prefer this approach since
1. I tried not to spread out the code complexity (introduced by inference
and operand type check) to too many places.
2. Adding our own converlet also introduces code complexity. And it
probably is more complicated than a wrapper.
> Query with BETWEEN clause on Date and Timestamp values fails with Validation
> Error
> ----------------------------------------------------------------------------------
>
> Key: DRILL-4525
> URL: https://issues.apache.org/jira/browse/DRILL-4525
> Project: Apache Drill
> Issue Type: Bug
> Components: Query Planning & Optimization
> Reporter: Abhishek Girish
> Assignee: Sean Hsuan-Yi Chu
> Priority: Critical
>
> Query: (simplified variant of TPC-DS Query37)
> {code}
> SELECT
> *
> FROM
> date_dim
> WHERE
> d_date BETWEEN Cast('1999-03-06' AS DATE) AND (
> Cast('1999-03-06' AS DATE) + INTERVAL '60' day)
> LIMIT 10;
> {code}
> Error:
> {code}
> Error: VALIDATION ERROR: From line 6, column 8 to line 7, column 64: Cannot
> apply 'BETWEEN ASYMMETRIC' to arguments of type '<ANY> BETWEEN ASYMMETRIC
> <DATE> AND <TIMESTAMP(0)>'. Supported form(s): '<COMPARABLE_TYPE> BETWEEN
> <COMPARABLE_TYPE> AND <COMPARABLE_TYPE>'
> SQL Query null
> [Error Id: 223fb37c-f561-4a37-9283-871dc6f4d6d0 on abhi2:31010]
> (state=,code=0)
> {code}
> This is a regression from 1.6.0.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)