Skip to content

SQL Chinese conditional garbled code#2754

Closed
Joe192168 wants to merge 1278 commits intobranch-1.21from
master
Closed

SQL Chinese conditional garbled code#2754
Joe192168 wants to merge 1278 commits intobranch-1.21from
master

Conversation

@Joe192168
Copy link

@Joe192168 Joe192168 commented Mar 25, 2022

1.30.0 Version is the same problem
result:
BQNYG{MV QF1L7%%OZS3T6P
debug:
StringLiteral()-->this is type case QUOTED_STRING branch,The source code is shown in the figure
image
image

tisonkun and others added 30 commits May 26, 2021 08:28
Signed-off-by: tison <wander4096@gmail.com>
Deprecate SqlStdOperatorTable.reverse(SqlOperator);
remove RexImplicationChecker.reverse(SqlOperator)
and SqlImplementor.reverseOperatorDirection(SqlOperator).
The fix is to remove the logic that generates ON conditions
and instead use the logic that is used for all other
expressions. This logic is more widely used, and therefore
already handles cases such as CASE. (Previous bugs such as
[CALCITE-3207] LIKE, [CALCITE-4610] Sarg, and
[CALCITE-1422] IS NULL have been caused by this unnecessary
split.)

We have retained the logic that reverses 't1.id = t0.id' to
't0.id = t1.id' if 't0' is from the left side of the join.

We have reverted one test case, which was accidentally
seeing 'mandatoryColumn IS NULL' simplified to 'FALSE',
because the simplification was not the point of the test.
…VER)

Add method RelBuilder.AggCall.over(), and class RelBuilder.OverCall.
Apache Commons Codec 1.12 has this (potential) security issue:
https://issues.apache.org/jira/browse/CODEC-134

Apache Calcite does not use Base32 impl from Commons Codec,
but merely the presence of the JAR means some security scanners freaks out.

Close #2399
1. Update version in README, and howto.md
2. Update copyright year in NOTICE
3. Add release notes
Remove html5shiv.min.js/respond.min.js

The scripts ensure compatibility with old web browsers such as IE9.
However, most (if not all) of these browsers are not used nowadays
cause they are very old thus there is no need to use these scripts.
1. Remove broken links.
2. Remove docker build instructions (there is no docker-compose file for Calcite).
3. Use GitHub URL to preview release notes.
4. Add subject template.
…termsQuery (Jacky Yin)

Translate SEARCH RexCall(In/NotIn) to termsQuery in ES.

Close #2420
…for aggregate functions (Rafay)

When we create RelCollation for WITHIN GROUP clause, we try to find the node in the group set first, which returns a RexNode which references the current group set instead of the field in the input. If the field is present in the group set, its index may not match with the field index in the input node, hence we get a mismatch, and then we wrongly add a new expression in SqlToRelConverter.AggConverter#lookupOrCreateGroupExpr method.
The solution is to disable the agg mode, which will force the SqlToRelConverter.Blackboard#convertExpression function to return the correct RexNode referencing from the input, without looking in the grouping set.
Formatting; import SqlDialect.DatabaseProduct to make code more concise.

Close #2431
In this change, we can parse and validate those functions,
but execution will be [CALCITE-4666].

Validation is based on new method SqlAggFunction.isPercentile()
(experimental and subject to change without notice).

There are connections between the RANGE clause in windowed
aggregate functions and interpolation used by PERCENTILE_CONT.
Therefore use the same logic to determine whether "x" is a
valid type in OVER (ORDER BY x RANGE r)" and
"PERCENTILE_CONT(f) WITHIN GROUP (ORER BY x)"

Close #2444
…correctly in the top-down mode (Vladimir Ozerov)
…rrelation variable is unused (James Starr)

Reworking the checking and validating if join is correlated in
RelBuilder.join to check if the correlated id is used on the right
side.If the correlated id is not used on the right side, then the join
is not correlated and a normal Join is emitted.

1.  Updating ToLogicalConverterTest to generate a non trival Correlate
2.  Adding tests for generating non trivial correlate joins to
RelBuilderTest.
3.  Updating plans in sub-query.iq, that are now simplified.

Close #2446
- Provide relFn pattern mechanism to test a RelNode function instead of a sql string
- Refactor several tests to use relFn
- Refactor similar tests by using common auxiliary methods
- Correct auxiliary methods names (use "check" prefix instead of "test" prefix)
case sensitivity parameter (Alon Eldar)

rebased original  PR #1792 from Feb2020.
…JdbcAdapter

Use EXPR$ prefix for naming columns when pushing projections
to avoid creating aliases with weird symbols such as '*'.
Such aliases may create problems in some DBMS such as Redshift
when the plan is converted to SQL via RelToSqlConverter.
zabetak and others added 22 commits February 14, 2022 10:33
…not working

1. Resolve the problem by removing the custom set of testClassesDirs
2. Set correctly the classpath to include JDBC drivers from a custom
configuration.
3. Add a bit of documentation around the JDBC tasks and configs.

Close #2716
The 1.4.197 version suffers from multiple CVEs such as:
https://nvd.nist.gov/vuln/detail/CVE-2018-14335
https://nvd.nist.gov/vuln/detail/CVE-2018-10054
https://nvd.nist.gov/vuln/detail/CVE-2021-42392
https://nvd.nist.gov/vuln/detail/CVE-2022-23221

In the project, we use H2 only for testing purposes thus the H2
binaries are not present in the runtime classpath thus these CVEs do
not pose a problem for Calcite or its users.

Close #2717
…lify to (A IS NOT NULL) When A is deterministic
…e sort if the view is used in a query at top level

The goal is for simple queries to retain the sorting. For example, given

  CREATE VIEW v AS
    SELECT *
    FROM emp
    WHERE job = 'CLERK'
    ORDER BY deptno

the query

  SELECT *
  FROM v
  WHERE ename LIKE 'M%'

will be expanded as if the user had written

  SELECT *
  FROM emp
  WHERE ename LIKE 'M%'
  AND job = 'CLERK'
  ORDER BY deptno

But the ORDER BY will be removed from more complex queries
(e.g. those involving GROUP BY, UNION, sub-query) where it
would have no effect.

If the ORDER BY also includes LIMIT or OFFSET, it affects the
rows returned, not just their sort order; such an ORDER BY is
never removed.

Close #2679
…n error

Cache Cassandra sessions based on "hostname, port, keyspace, username, password" information.
[CALCITE-4054] RepeatUnion containing a Correlate with a transientScan on its RHS causes NPE
According to https://www.jacoco.org/jacoco/trunk/doc/faq.html , Jacoco
adds a synthetic static method called $jacocoInit() during
instrumentation.

MetadataDef constructor breaks if it encounters such method on
the class given to it because it does not expect it. But it looks like
it simply should not consider synthetic methods (as well as static
methods) at all.

- extract code for finding handler methods
- reuse it in both places
- add tests concerning synthetic methods
commons-io versions before 2.7 suffer from CVE-2021-29425 which allows
to traverse into the parent directory.

Update to a more recent version to avoid the afforementioned security
vulnerability and benefit from the other improvements in this library.

Close #2734
1. Highlight the role & existence of two repos at the beginning of
README.
2. Provide a high-level overview of the update procedure early on.
3. Move RM related instructions from README to the appropriate howto
sections.
4. Remove git reset/rebase related commands for syncing master & site
branches from the beginning of the release process cause it is too
early to rebase then. Mention rebase later towards the end of the
process.

Close #2708
…leTable and projections and filters act on different columns
…eConsistency fails

[CALCITE-4872] added an UNKNOWN type that was implemented in some
places by class SqlTypeFactoryImpl.UnknownSqlType, but in others
by BasicSqlType. This would cause
SqlTypeFactoryTest.testUnknownCreateWithNullabilityTypeConsistency
to succeed or fail non-deterministically, depending on which of the
above had made it into the map of canonical type instances.

This commit solves the problem by removing class
SqlTypeFactoryImpl.UnknownSqlType and always using BasicSqlType.
Upgrade HSQLDB to 2.5.2 (the last version that also supports
Java 8) and allow people to run using HSQLDB 2.6.1 (the most
recent version, which requires Java 11 or higher).

Also upgrade data sets:
 * scott-data-hsqldb from 0.1 to 0.2;
 * foodmart-data-hsqldb from 0.4 to 0.5;
 * chinook-data-hsqldb from 0.1 to 0.2.

The previous versions of those data sets used HSQLDB file
format 1.8, and the newer versions use 2.0 format.
…an Aggregate with no GROUP BY always returns 1 row

Close #2746
…ich some dialects wrongly interpret as a reference to a field

When an ORDER BY field turns out to be an integer literal,
if the target dialect treats ordinals as field references,
RelToRelConverter now generates a character literal
instead. All constants have no effect on the sort, and
therefore the character literal has the desired effect.

Close #2749
@NobiGo
Copy link
Contributor

NobiGo commented Mar 25, 2022

@Joe192168 Hi, If this is a real problem, Please describe the issue in JIRA

@XuQianJin-Stars
Copy link
Contributor

please rebase this pr?

@hsyuan
Copy link
Member

hsyuan commented Mar 30, 2022

@Joe192168 Thanks for contributing. Can you log a JIRA and open a new pull request? I am closing this one.

@hsyuan hsyuan closed this Mar 30, 2022
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.