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

[HZ-1119] Nested types support #19954

Conversation

ivanthescientist
Copy link
Contributor

@ivanthescientist ivanthescientist commented Nov 16, 2021

Adds support for nested fields for Java classes, WIP.

Changes behavior of default OBJECT type to support nested fields.

# Conflicts:
#	hazelcast-sql/src/main/java/com/hazelcast/sql/impl/calcite/parse/QueryParser.java
# Conflicts:
#	hazelcast-sql/src/main/java/com/hazelcast/sql/impl/calcite/schema/HazelcastTable.java
#	hazelcast-sql/src/test/java/com/hazelcast/sql/impl/expression/NestingAndCasingExpressionTest.java
# Conflicts:
#	hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/HazelcastSqlToRelConverter.java
#	hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/opt/OptUtils.java
#	hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/schema/HazelcastCalciteCatalogReader.java
#	hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/schema/HazelcastTable.java
#	hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/validate/HazelcastSqlOperatorTable.java
#	hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/validate/operand/TypedOperandChecker.java
#	hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/validate/operators/typeinference/JsonFunctionOperandTypeInference.java
#	hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/validate/operators/typeinference/json/HazelcastJsonQueryFunction.java
#	hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/validate/operators/typeinference/json/HazelcastJsonValueFunction.java
#	hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/validate/operators/typeinference/json/HazelcastParseJsonFunction.java
#	hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/validate/operators/typeinference/json/JsonFunctionUtil.java
#	hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/validate/types/HazelcastJsonType.java
#	hazelcast/src/main/java/com/hazelcast/sql/impl/SqlDataSerializerHook.java
# Conflicts:
#	hazelcast-sql/src/test/java/com/hazelcast/jet/sql/impl/expression/misc/CastFunctionIntegrationTest.java
# Conflicts:
#	hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/connector/SqlConnector.java
#	hazelcast-sql/src/test/java/com/hazelcast/jet/sql/impl/connector/kafka/SqlJsonTest.java
@hazelcast hazelcast deleted a comment from hz-devops-test Aug 16, 2022
@hazelcast hazelcast deleted a comment from hz-devops-test Aug 16, 2022
Copy link
Contributor

@krzysztofslusarski krzysztofslusarski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First glance over PR

}

private boolean isPrimitive(Class<?> clazz) {
return clazz.getPackage().getName().startsWith("java.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a method java.lang.Class#isPrimitive.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, String is also primitive. It's a sanity check, it should not normally happen. I think we can convert it to an assert.

Copy link
Contributor Author

@ivanthescientist ivanthescientist Aug 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will not work with Map, List etc. We want to skip those too. Bad name for the method though probably.

@hazelcast hazelcast deleted a comment from hz-devops-test Aug 17, 2022
Copy link
Contributor

@mdumandag mdumandag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a very superficial review from the client's perspective, it looked okay. I just have one objection, but it is a simple thing, and I will therefore approve this.

But, I would like to spend more time on this PR after BETA release to do a proper review

ivanthescientist and others added 6 commits August 17, 2022 20:32
# Conflicts:
#	hazelcast-sql/src/main/java/com/hazelcast/jet/sql/impl/schema/TablesStorage.java
…ject-based' into feature/5.1/nested-data-types-object-based
@hazelcast hazelcast deleted a comment from hz-devops-test Aug 17, 2022
@hazelcast hazelcast deleted a comment from hz-devops-test Aug 17, 2022
@hazelcast hazelcast deleted a comment from hz-devops-test Aug 17, 2022
}

private boolean isPrimitive(Class<?> clazz) {
return clazz.getPackage().getName().startsWith("java.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, String is also primitive. It's a sanity check, it should not normally happen. I think we can convert it to an assert.

@hazelcast hazelcast deleted a comment from hz-devops-test Aug 17, 2022
@hazelcast hazelcast deleted a comment from hz-devops-test Aug 17, 2022
@hz-devops-test
Copy link

The job Hazelcast-pr-builder of your PR failed. (Hazelcast internal details: build log, artifacts).
Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log file
--------------------------
-------TEST FAILURE-------
--------------------------
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   ClientMapPartitionLostListenerTest.test_mapPartitionLostListener_invoked_fromOtherNode:133->assertProxyExistsEventually:163->HazelcastTestSupport.assertTrueEventually:1338->HazelcastTestSupport.assertTrueEventually:1236 There is no proxy with name 2568f76e-21e5-4de1-8449-2ad16d2918b6 created (yet)
[INFO] 
[ERROR] Tests run: 50737, Failures: 1, Errors: 0, Skipped: 238
[INFO] 

[ERROR] There are test failures.

@hz-devops-test
Copy link

The job Hazelcast-pr-builder of your PR failed. (Hazelcast internal details: build log, artifacts).
Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log file
--------------------------
-------TEST FAILURE-------
--------------------------
[INFO] Results:
[INFO] 
[ERROR] Failures: 
[ERROR]   QueueDestroyTest.checkStatsMapEntryRemovedWhenQueueDestroyed:78 expected:<0> but was:<1>
[INFO] 
[ERROR] Tests run: 50737, Failures: 1, Errors: 0, Skipped: 238
[INFO] 

[ERROR] There are test failures.

@ivanthescientist ivanthescientist merged commit 67a8b58 into hazelcast:master Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Source: Internal PR or issue was opened by an employee Team: SQL Type: Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants