forked from apache/calcite
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ing intersect keys between target keys and group keys
…Calc and LogicalTableModify
…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
… if subquery uses table from left join
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
…zation This closes apache#2955
… in WITH_ITEM body This closes apache#2952
…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
…d becoming a contributor
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.