Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test 5489 druid #16

Merged
merged 209 commits into from
Oct 25, 2024
Merged

Test 5489 druid #16

merged 209 commits into from
Oct 25, 2024

Conversation

JiajunBernoulli
Copy link
Owner

No description provided.

libenchao and others added 30 commits May 16, 2022 09:57
…ing intersect keys between target keys and group keys
…rom 'LHS.C1 = RHS.C1 AND LHS.C2 = RHS.C1'

Cosmetic fix-ups by Chunwei Lei.

Close apache#2761
Create an immutable version of class ListSqlOperatorTable,
to be created via SqlOperatorTables.of.

class ListSqlOperatorTable still exists but its constructors
and add(SqlOperator) methods are deprecated. We hope that
people will create immutable operator tables most of the time.

Refactor MockSqlOperatorTable to be immutable. Methods that
mutate the table, such as addRamp, are replaced by methods
that return a copy.

When creating a ChainedSqlOperatorTable, flatten constituent
tables that are a ChainedSqlOperatorTable, and remove
constituent tables that are immutable and empty.
Allow comma only at top level in FROM clause.
Add new join operator, COMMA-JOIN, with slightly lower
precedence than JOIN, to that unparsing works correctly.

Move test case from JdbcTest to join.iq.

Includes changes from PR apache#1204, authored by
Muhammad Gelbana <[email protected]>

Close apache#1204
Close apache#2820

Co-authored-by: Muhammad Gelbana <[email protected]>
Partial revert of deduplication in LogicalTableFunctionScan
(CALCITE-4673) since the deduplication in Project is more general and
covers the previous use-case as well.

Close apache#2825
Syntax is enabled if SqlConformance.isOffsetLimitAllowed() returns true.

Refactor parser:
 * Rename startCount to offsetFetch (based on the standard
   names of the clauses). Extract FETCH into its own method.
 * Disallow FETCH if parser has already seen LIMIT.

Close apache#2768
…uery dialect

Before this change, the expression

  DATE '2018-02-17'

fails to parse in BigQuery dialect because the parser
requires a <QUOTED_STRING> token and actually sees a
<BIG_QUERY_QUOTED_STRING> token. Similarly TIME, TIMESTAMP,
LITERAL literals. After this change, the above single-quoted
form succeeds, as does the double-quoted form like this:

  DATE "2018-02-17"

In SqlParserUtil, the methods parseDateLiteral,
parseTimeLiteral, parseTimestampLiteral and
parseIntervalLiteral expected a quoted string as an argument
(e.g. "'2018-02-17'") and now expect just the value (e.g.
"2018-02-17'"). Callers should now call parseString on the
argument first.

Close apache#2823
…ore than two items when SqlDialect#supportsAliasedValues is false
…XTRACT, DATE_PART, DATEADD, DATEDIFF and similar functions

Time unit abbreviations are specified in
SqlParser.Config.timeUnitCodes().

Since [CALCITE-2496], EXTRACT supports MICROSECOND and
NANOSECOND by default but FLOOR and CEIL do not. With this
change, you could configure FLOOR and CEIL to also support
those units.

Close apache#2807
tindzk and others added 29 commits January 12, 2023 16:55
The following conversion does not work as expected:

cast(_MAP['date'] as TIMESTAMP)

The resulting date is always 1970-01-01 and only the fractional seconds are set.
…rting an array

The following conversion does not work as expected:

```
cast(_MAP['arr'] as VARCHAR ARRAY)
```

This throws the following exception:

```
Caused by: java.lang.NullPointerException: componentType of ITEM($0, 'arr')
    at java.base/java.util.Objects.requireNonNull(Objects.java:347)
    at org.apache.calcite.sql2rel.StandardConvertletTable.convertCast(StandardConvertletTable.java:603)
    at org.apache.calcite.sql2rel.SqlNodeToRexConverterImpl.convertCall(SqlNodeToRexConverterImpl.java:59)
    at org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:5547)
    at org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.visit(SqlToRelConverter.java:4711)
    at org.apache.calcite.sql.SqlCall.accept(SqlCall.java:161)
    at org.apache.calcite.sql2rel.SqlToRelConverter$Blackboard.convertExpression(SqlToRelConverter.java:5360)
    at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectList(SqlToRelConverter.java:4524)
    at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelectImpl(SqlToRelConverter.java:756)
    at org.apache.calcite.sql2rel.SqlToRelConverter.convertSelect(SqlToRelConverter.java:677)
    at org.apache.calcite.sql2rel.SqlToRelConverter.convertQueryRecursive(SqlToRelConverter.java:3741)
    at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:597)
    at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:257)
    at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:220)
    at org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:651)
    at org.apache.calcite.prepare.CalcitePrepareImpl.prepare_(CalcitePrepareImpl.java:517)
    at org.apache.calcite.prepare.CalcitePrepareImpl.prepareSql(CalcitePrepareImpl.java:487)
    at org.apache.calcite.jdbc.CalciteConnectionImpl.parseQuery(CalciteConnectionImpl.java:236)
    at org.apache.calcite.jdbc.CalciteMetaImpl.prepareAndExecute(CalciteMetaImpl.java:623)
    at org.apache.calcite.avatica.AvaticaConnection.prepareAndExecuteInternal(AvaticaConnection.java:677)
    at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:156)
    ... 67 more
```
…valent to CHAR_LENGTH)

Add LENGTH() as a library function as an alias for the
standard CHAR_LENGTH(). Refactor some dependencies for
deprecated standard functions to avoid NullPointerException
due to circular dependencies.

Close apache#3011
In order to keep redshift.iq (the Quidem test for the
Redshift dialect using the Babel parser) working, we ensure
that the Redshift variant of DATE_TRUNC (which has arguments
in a different order than the BigQuery variant) can still be
handled by the parser, even though we still cannot execute
it.

Close apache#3009
Considering the modules in isolation leads to some modules
(e.g., testkit) reporting low coverage. The use of
jacoco-report-aggregation plugin alleviates the problem by aggregating
the coverage analysis from the individual modules into one unified
report.

While testing the changes there was one Jenkins job that got stuck
and kept running for almost ~24h. To prevent similar situation in the
future a 1h timeout is set in the code quality stage.

Close apache#3027
…ractMonths to use DateTimeUtils from Avatica
This fixes a regression introduced by [CALCITE-5423].

Close apache#3041
If the output of a parser test case is the same as its
input, it now must call same().
…nto new class IntervalTest

This change allows interval tests to be shared between the
parser and validator test without maintaining duplicate
test code.
…ons such as EXTRACT, DATE_TRUNC

In OperandTypes, add strategies for matching DATE, TIME,
TIMESTAMP frames; DATE and TIMESTAMP frames include
ISOYEAR, WEEK(THURSDAY).

Enable tests for ISOYEAR, now that the upgrade to Avatica
1.23 has brought in the fix to [CALCITE-5369], ISOYEAR in
FLOOR and CEIL functions.
Literals introduced by the keyword DATE, TIME, DATETIME,
TIMESTAMP, TIMESTAMP WITH LOCAL TIME ZONE are represented by
the parser by new class SqlUnknownLiteral. Determining the
actual type is deferred until validation time; the validator
determines the actual type based on the type system's type
alias map, and then validates the character string.

Close apache#3036

Co-authored-by: Julian Hyde <[email protected]>
Co-authored-by: Oliver Lee <[email protected]>
…tors

In RelJson, add create() method and deprecate constructor;
add methods withOperatorTable, withLibraryOperatorTable,
withJsonBuilder to further control its behavior.

Add argument to RelJsonWriter and RelJsonReader constructors
to allow configuring their embedded RelJson object.

Close apache#2954
…nnot convert a TIMESTAMP literal to a org.apache.calcite.avatica.util.TimeUnit

Close apache#3040
Close apache#3048

Co-authored-by: Tanner Clary <[email protected]>
Co-authored-by: Sergey Nuyanzin <[email protected]>
@JiajunBernoulli JiajunBernoulli merged commit c4155b8 into main Oct 25, 2024
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.