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

[Druid Success]Test 5383 druid #15

Merged
merged 139 commits into from
Oct 25, 2024
Merged

[Druid Success]Test 5383 druid #15

merged 139 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
snuyanzin and others added 28 commits October 25, 2022 22:37
Add a Gradle task to automatically update the checksum in
the Gradle Wrapper.

In HOWTO guide, add a section 'How to ugrade Gradle and the
Gradle Wrapper', and update the Gradle version.

Close apache#2841
… Actions

The ASF is discontinuing Travis CI for testing, and it will no longer be
available after 31 December 2022.
…ce files are not identical

File check added to the following test suites:
- HepPlannerTest
- RelOptRulesTest
- RuleMatchVisualizerTest
- SqlHintsConverterTest
- SqlToRelConverterTest
- SqlPrettyWriterTest
- TypeCoercionConverterTest
- TopDownOptTest

Updated XML test reference files:
- HepPlannerTest.xml
- RelOptRulesTest.xml
- SqlHintsConverterTest.xml
- SqlToRelConverterTest.xml
- TypeCoercionConverterTest.xml
…JoinTransposeRule

We should not push down dangerous expressions through Join at last, see more in CALCITE-5315.
In this issue, we fixed this by stop pushing down 'cast to not null' through Join for a quick fix.

This closes 2686
Break up the constructor into a builder pattern, and make
RexImpTable immutable after construction.

The constructor was getting too long (approaching 400
lines), so this change introduces a private static class
Builder and moves initialization into chained populate()
and populate2() methods.

Usually we put inner classes towards the end of the file.
In this case, we put the Builder inner class after the
constructor, in order to reduce diff noise.
Whether `SqlValidatorUtil.getAlias` returns null depends on whether the
ordinal argument is less than zero, which makes it difficult to reason
about nullability. Replace with two methods `alias(SqlNode)` that is
nullable and `alias(SqlNode, int)` that is not nullable.
In SqlSingleOperandTypeChecker.java add default method
implementations so that subtypes don't need to.

Add OperandTypes.interval(SqlTypeName) to match an interval
operand.

Add CompositeOperandTypeChecker.withGenerator, so that a
checker can generate signatures given a function name, as
opposed to hard-coding the function name in the signatures
as today.

Add SqlOperandTypeChecker.and,
SqlSingleOperandTypeChecker.or, and similar methods, to
combine checkers using a binary operation. Flatten composite
checkers, so that 'or(or(a, b), c)' becomes 'or(a, b,c)'.
Add method SqlValidatorNamespace.field
…efault null collation (e.g. NULLS LAST)

This repeats the fix that was made in [CALCITE-2323] and
that I accidentally undid in [CALCITE-4497].

Deprecate method SqlToRelConverter.convertSortExpression;
makeOver now goes directly to RexNode rather than using an
intermediate RexFieldCollation.
Add functions DATEADD, DATEDIFF, DATEPART, DATE_PART as
aliases of TIMESTAMPADD, TIMESTAMPDIFF, EXTRACT. (Not fully
implemented yet.)
Before this change, you can use the ISO SQL time units
(SECOND, HOUR, DAY, MONTH, YEAR, etc.) to perform datetime
arithmetic (FLOOR, CEIL, EXTRACT) and also when defining
materialized views and using them in queries. But
applications would like to be able to define their own time
frames, such as "MINUTE15" (a 15 minute period aligned with
the hour) or "MONTH4" (a 4 month period aligned with the
year), or "WEEK(THURSDAY)" (a 7 day week that starts on a
Thursday).

After this change, applications can define their own time
frames. We add a `class TimeFrameSet`, and in the
`interface RelDataTypeSystem` we add a method `TimeFrameSet
deriveTimeFrameSet(TimeFrameSet frameSet)`. This method is
called during query preparation, and the application has
the opportunity to define a set that contains custom and
existing time frames.

Time frames can be defined that are multiples of and multiply
to built-in time frames (as, for example, MINUTE is a
multiple of SECOND and MILLISECOND multiplies to SECOND).
You can also define that a time frame is aligned with
another (as, for example, DAY is aligned with MONTH even
though the multiplier is not constant).

The following functions allow time frame arguments:
 * DATEADD (Postgres, MSSql)
 * DATEDIFF (Postgres, MSSql)
 * DATEPART (MSSql)
 * DATE_PART (Postgres)
 * EXTRACT (Calcite built-in, also SQL standard)
 * CEIL (Calcite built-in)
 * FLOOR (Calcite built-in)
 * TIMESTAMPADD (Calcite built-in, also JDBC standard)
 * TIMESTAMPDIFF (Calcite-builtin, also JDBC standard)
 * TIMESTAMP_TRUNC (BigQuery)
 * TIME_TRUNC (BigQuery)

Calls to the above functions with invalid time units would
previously be a parse error and are now detected during
validation.

The SQL_TSI_xxx (e.g. SQL_TSI_HOUR) arguments are treated
as time frames, and the parser passes them as identifiers.
They are no longer reserved keywords.

Previously, NANOSECOND and MILLISECOND were allowed in
EXTRACT but no other functions. Now all functions that
accept time frames accept the same time frames (built-in
time intervals, identifiers for user-defined time frames,
and SQL_TSI_xxx which are defined in the JDBC standard but
are treated as identifiers until validation).

The representation of calls to the above functions has
changed. Previously the operand was a time unit, now it is
an identifier.

Deprecate SqlAbstractParserImpl.setTimeUnitCodes() and
SqlParser.Config.timeUnitCodes(), because you can now create
aliases for time units by creating custom time frames using
TimeFrameSet.Builder.alias().

Add commons-math3 as a dependency because TimeFrame uses
BigFraction.

Currently ISO_YEAR is not handled by DATEADD, TIMESTAMPADD,
DATEDIFF, TIMESTAMPDIFF, etc. Adding or subtracting an
ISO_YEAR will no-op. I don't know what the behavior should
be.

Close apache#2960
@JiajunBernoulli JiajunBernoulli changed the title Test 5383 druid [Druid Success]Test 5383 druid Dec 3, 2023
@JiajunBernoulli JiajunBernoulli merged commit 12e9ad4 into main Oct 25, 2024
13 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.