diff --git a/build.gradle b/build.gradle index 0a8733780..446ccb856 100644 --- a/build.gradle +++ b/build.gradle @@ -34,10 +34,10 @@ allprojects { repositories { mavenCentral() maven { - url 'https://linkedin.jfrog.io/artifactory/avro-util/' + url 'https://linkedin.jfrog.io/artifactory/dependency-overrides' } maven { - url 'https://linkedin.bintray.com/maven/' + url 'https://linkedin.jfrog.io/artifactory/open-source/' } } @@ -78,4 +78,8 @@ subprojects { apply from: "${rootDir}/gradle/dependencies.gradle" apply from: "${rootDir}/gradle/java-publication.gradle" + + tasks.named('javadoc') { + enabled = false + } } diff --git a/coral-common/build.gradle b/coral-common/build.gradle index 3a0ba7fe7..02783df1c 100644 --- a/coral-common/build.gradle +++ b/coral-common/build.gradle @@ -1,14 +1,7 @@ dependencies { - compile(deps.'linkedin-calcite-core') { - artifact { - name = 'calcite-core' - extension = 'jar' - type = 'jar' - classifier = 'shaded' - } - } + api(deps.'linkedin-calcite-core') - compile(deps.'hive'.'hive-metastore') { + implementation(deps.'hive'.'hive-metastore') { exclude group: 'com.linkedin.metastore-autometrics', module: 'autometrics-reporter' exclude group: 'com.linkedin.metastore-audit', module: 'metastore-audit-logging' // avro-tools brings in whole bunch of hadoop classes causing duplicates and conflicts diff --git a/coral-common/src/main/java/com/linkedin/coral/common/CoralJavaTypeFactoryImpl.java b/coral-common/src/main/java/com/linkedin/coral/common/CoralJavaTypeFactoryImpl.java index cd2b05b04..b8c5dbe6e 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/CoralJavaTypeFactoryImpl.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/CoralJavaTypeFactoryImpl.java @@ -1,5 +1,5 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,10 +7,10 @@ import java.util.List; -import org.apache.calcite.jdbc.JavaTypeFactoryImpl; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeSystem; -import org.apache.calcite.rel.type.StructKind; +import com.linkedin.relocated.org.apache.calcite.jdbc.JavaTypeFactoryImpl; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeSystem; +import com.linkedin.relocated.org.apache.calcite.rel.type.StructKind; /** diff --git a/coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java b/coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java index e57c19927..c8d468c98 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/FuzzyUnionSqlRewriter.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -14,14 +14,13 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.Sets; - -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.rel.type.RelDataTypeField; -import org.apache.calcite.sql.*; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.calcite.sql.util.SqlShuttle; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFactory; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeField; +import com.linkedin.relocated.org.apache.calcite.sql.*; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.sql.util.SqlShuttle; import com.linkedin.coral.common.functions.GenericProjectFunction; import com.linkedin.coral.common.utils.RelDataTypeToHiveTypeStringConverter; diff --git a/coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java b/coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java index 9bc12afa1..1fdca759b 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/HiveDbSchema.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -12,10 +12,9 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; - -import org.apache.calcite.linq4j.tree.Expression; -import org.apache.calcite.rel.type.RelProtoDataType; -import org.apache.calcite.schema.*; +import com.linkedin.relocated.org.apache.calcite.linq4j.tree.Expression; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelProtoDataType; +import com.linkedin.relocated.org.apache.calcite.schema.*; import static com.google.common.base.Preconditions.checkNotNull; diff --git a/coral-common/src/main/java/com/linkedin/coral/common/HiveRelBuilder.java b/coral-common/src/main/java/com/linkedin/coral/common/HiveRelBuilder.java index 09deaa1e2..6bcc0d30e 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/HiveRelBuilder.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/HiveRelBuilder.java @@ -1,5 +1,5 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -9,35 +9,34 @@ import java.util.List; import com.google.common.base.Preconditions; +import com.linkedin.relocated.org.apache.calcite.plan.Context; +import com.linkedin.relocated.org.apache.calcite.plan.Contexts; +import com.linkedin.relocated.org.apache.calcite.plan.RelOptCluster; +import com.linkedin.relocated.org.apache.calcite.plan.RelOptSchema; +import com.linkedin.relocated.org.apache.calcite.rel.core.Values; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFactory; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeField; +import com.linkedin.relocated.org.apache.calcite.rex.RexBuilder; +import com.linkedin.relocated.org.apache.calcite.tools.FrameworkConfig; +import com.linkedin.relocated.org.apache.calcite.tools.Frameworks; +import com.linkedin.relocated.org.apache.calcite.tools.RelBuilder; +import com.linkedin.relocated.org.apache.calcite.tools.RelBuilderFactory; +import com.linkedin.relocated.org.apache.calcite.util.Pair; -import org.apache.calcite.plan.Context; -import org.apache.calcite.plan.Contexts; -import org.apache.calcite.plan.RelOptCluster; -import org.apache.calcite.plan.RelOptSchema; -import org.apache.calcite.rel.core.Values; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.rel.type.RelDataTypeField; -import org.apache.calcite.rex.RexBuilder; -import org.apache.calcite.tools.FrameworkConfig; -import org.apache.calcite.tools.Frameworks; -import org.apache.calcite.tools.RelBuilder; -import org.apache.calcite.tools.RelBuilderFactory; -import org.apache.calcite.util.Pair; - -import static org.apache.calcite.rel.core.RelFactories.DEFAULT_AGGREGATE_FACTORY; -import static org.apache.calcite.rel.core.RelFactories.DEFAULT_EXCHANGE_FACTORY; -import static org.apache.calcite.rel.core.RelFactories.DEFAULT_FILTER_FACTORY; -import static org.apache.calcite.rel.core.RelFactories.DEFAULT_JOIN_FACTORY; -import static org.apache.calcite.rel.core.RelFactories.DEFAULT_MATCH_FACTORY; -import static org.apache.calcite.rel.core.RelFactories.DEFAULT_PROJECT_FACTORY; -import static org.apache.calcite.rel.core.RelFactories.DEFAULT_REPEAT_UNION_FACTORY; -import static org.apache.calcite.rel.core.RelFactories.DEFAULT_SET_OP_FACTORY; -import static org.apache.calcite.rel.core.RelFactories.DEFAULT_SNAPSHOT_FACTORY; -import static org.apache.calcite.rel.core.RelFactories.DEFAULT_SORT_EXCHANGE_FACTORY; -import static org.apache.calcite.rel.core.RelFactories.DEFAULT_SORT_FACTORY; -import static org.apache.calcite.rel.core.RelFactories.DEFAULT_SPOOL_FACTORY; -import static org.apache.calcite.rel.core.RelFactories.DEFAULT_TABLE_SCAN_FACTORY; -import static org.apache.calcite.rel.core.RelFactories.DEFAULT_VALUES_FACTORY; +import static com.linkedin.relocated.org.apache.calcite.rel.core.RelFactories.DEFAULT_AGGREGATE_FACTORY; +import static com.linkedin.relocated.org.apache.calcite.rel.core.RelFactories.DEFAULT_EXCHANGE_FACTORY; +import static com.linkedin.relocated.org.apache.calcite.rel.core.RelFactories.DEFAULT_FILTER_FACTORY; +import static com.linkedin.relocated.org.apache.calcite.rel.core.RelFactories.DEFAULT_JOIN_FACTORY; +import static com.linkedin.relocated.org.apache.calcite.rel.core.RelFactories.DEFAULT_MATCH_FACTORY; +import static com.linkedin.relocated.org.apache.calcite.rel.core.RelFactories.DEFAULT_PROJECT_FACTORY; +import static com.linkedin.relocated.org.apache.calcite.rel.core.RelFactories.DEFAULT_REPEAT_UNION_FACTORY; +import static com.linkedin.relocated.org.apache.calcite.rel.core.RelFactories.DEFAULT_SET_OP_FACTORY; +import static com.linkedin.relocated.org.apache.calcite.rel.core.RelFactories.DEFAULT_SNAPSHOT_FACTORY; +import static com.linkedin.relocated.org.apache.calcite.rel.core.RelFactories.DEFAULT_SORT_EXCHANGE_FACTORY; +import static com.linkedin.relocated.org.apache.calcite.rel.core.RelFactories.DEFAULT_SORT_FACTORY; +import static com.linkedin.relocated.org.apache.calcite.rel.core.RelFactories.DEFAULT_SPOOL_FACTORY; +import static com.linkedin.relocated.org.apache.calcite.rel.core.RelFactories.DEFAULT_TABLE_SCAN_FACTORY; +import static com.linkedin.relocated.org.apache.calcite.rel.core.RelFactories.DEFAULT_VALUES_FACTORY; /** diff --git a/coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java b/coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java index 0450222fe..97e062c75 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/HiveSchema.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -13,10 +13,10 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; +import com.linkedin.relocated.org.apache.calcite.linq4j.tree.Expression; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelProtoDataType; +import com.linkedin.relocated.org.apache.calcite.schema.*; -import org.apache.calcite.linq4j.tree.Expression; -import org.apache.calcite.rel.type.RelProtoDataType; -import org.apache.calcite.schema.*; import org.apache.hadoop.hive.metastore.api.Database; import static com.google.common.base.Preconditions.checkNotNull; diff --git a/coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java b/coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java index 1df9fa940..c1f7f0b38 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/HiveTable.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -16,18 +16,18 @@ import com.google.common.base.Splitter; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; +import com.linkedin.relocated.org.apache.calcite.DataContext; +import com.linkedin.relocated.org.apache.calcite.config.CalciteConnectionConfig; +import com.linkedin.relocated.org.apache.calcite.linq4j.Enumerable; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFactory; +import com.linkedin.relocated.org.apache.calcite.schema.ScannableTable; +import com.linkedin.relocated.org.apache.calcite.schema.Schema; +import com.linkedin.relocated.org.apache.calcite.schema.Statistic; +import com.linkedin.relocated.org.apache.calcite.schema.Statistics; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; -import org.apache.calcite.DataContext; -import org.apache.calcite.config.CalciteConnectionConfig; -import org.apache.calcite.linq4j.Enumerable; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.schema.ScannableTable; -import org.apache.calcite.schema.Schema; -import org.apache.calcite.schema.Statistic; -import org.apache.calcite.schema.Statistics; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlNode; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hive.metastore.MetaStoreUtils; import org.apache.hadoop.hive.metastore.TableType; diff --git a/coral-common/src/main/java/com/linkedin/coral/common/HiveTypeSystem.java b/coral-common/src/main/java/com/linkedin/coral/common/HiveTypeSystem.java index 6372a220b..2068b7555 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/HiveTypeSystem.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/HiveTypeSystem.java @@ -1,15 +1,15 @@ /** - * Copyright 2017-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.common; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.rel.type.RelDataTypeSystemImpl; -import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.calcite.sql.type.SqlTypeUtil; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFactory; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeSystemImpl; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeUtil; // Precision and scale values copied from Hive source code diff --git a/coral-common/src/main/java/com/linkedin/coral/common/HiveUncollect.java b/coral-common/src/main/java/com/linkedin/coral/common/HiveUncollect.java index ff7a1d1b1..b50aa4052 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/HiveUncollect.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/HiveUncollect.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,18 +7,19 @@ import java.util.List; -import org.apache.calcite.plan.Convention; -import org.apache.calcite.plan.RelOptCluster; -import org.apache.calcite.plan.RelTraitSet; -import org.apache.calcite.rel.RelInput; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.rel.core.Uncollect; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.rel.type.RelDataTypeField; -import org.apache.calcite.sql.SqlUnnestOperator; -import org.apache.calcite.sql.type.MapSqlType; -import org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.plan.Convention; +import com.linkedin.relocated.org.apache.calcite.plan.RelOptCluster; +import com.linkedin.relocated.org.apache.calcite.plan.RelTraitSet; +import com.linkedin.relocated.org.apache.calcite.rel.RelInput; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.rel.core.Uncollect; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFactory; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeField; +import com.linkedin.relocated.org.apache.calcite.sql.SqlUnnestOperator; +import com.linkedin.relocated.org.apache.calcite.sql.type.MapSqlType; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/coral-common/src/main/java/com/linkedin/coral/common/HiveViewTable.java b/coral-common/src/main/java/com/linkedin/coral/common/HiveViewTable.java index b71b8623c..820044596 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/HiveViewTable.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/HiveViewTable.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,16 +7,16 @@ import java.util.List; -import org.apache.calcite.plan.RelOptTable; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.rel.RelRoot; -import org.apache.calcite.schema.TranslatableTable; -import org.apache.hadoop.hive.metastore.api.Table; +import com.google.common.base.Throwables; +import com.google.common.collect.ImmutableList; +import com.linkedin.relocated.org.apache.calcite.plan.RelOptTable; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.rel.RelRoot; +import com.linkedin.relocated.org.apache.calcite.schema.TranslatableTable; -import com.linkedin.coral.com.google.common.base.Throwables; -import com.linkedin.coral.com.google.common.collect.ImmutableList; +import org.apache.hadoop.hive.metastore.api.Table; -import static org.apache.calcite.sql.type.SqlTypeName.*; +import static com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName.*; /** diff --git a/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java b/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java index 236c58151..5efdc4422 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveDbSchema.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -12,10 +12,9 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; - -import org.apache.calcite.linq4j.tree.Expression; -import org.apache.calcite.rel.type.RelProtoDataType; -import org.apache.calcite.schema.*; +import com.linkedin.relocated.org.apache.calcite.linq4j.tree.Expression; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelProtoDataType; +import com.linkedin.relocated.org.apache.calcite.schema.*; import static com.google.common.base.Preconditions.checkNotNull; diff --git a/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java b/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java index 42c6890da..6960edc7b 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveSchema.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -12,10 +12,9 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; - -import org.apache.calcite.linq4j.tree.Expression; -import org.apache.calcite.rel.type.RelProtoDataType; -import org.apache.calcite.schema.*; +import com.linkedin.relocated.org.apache.calcite.linq4j.tree.Expression; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelProtoDataType; +import com.linkedin.relocated.org.apache.calcite.schema.*; import static com.google.common.base.Preconditions.checkNotNull; diff --git a/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveTable.java b/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveTable.java index b459d1473..58b78d666 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveTable.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/LocalMetastoreHiveTable.java @@ -1,5 +1,5 @@ /** - * Copyright 2020-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2020-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,17 +8,18 @@ import java.util.ArrayList; import java.util.List; -import org.apache.calcite.DataContext; -import org.apache.calcite.config.CalciteConnectionConfig; -import org.apache.calcite.linq4j.Enumerable; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.schema.ScannableTable; -import org.apache.calcite.schema.Schema; -import org.apache.calcite.schema.Statistic; -import org.apache.calcite.schema.Statistics; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.DataContext; +import com.linkedin.relocated.org.apache.calcite.config.CalciteConnectionConfig; +import com.linkedin.relocated.org.apache.calcite.linq4j.Enumerable; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFactory; +import com.linkedin.relocated.org.apache.calcite.schema.ScannableTable; +import com.linkedin.relocated.org.apache.calcite.schema.Schema; +import com.linkedin.relocated.org.apache.calcite.schema.Statistic; +import com.linkedin.relocated.org.apache.calcite.schema.Statistics; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; + import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo; import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils; diff --git a/coral-common/src/main/java/com/linkedin/coral/common/ToRelConverter.java b/coral-common/src/main/java/com/linkedin/coral/common/ToRelConverter.java index 067a502bb..06c61e246 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/ToRelConverter.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/ToRelConverter.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -11,33 +11,31 @@ import javax.annotation.Nonnull; +import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; - -import org.apache.calcite.config.CalciteConnectionConfig; -import org.apache.calcite.config.CalciteConnectionConfigImpl; -import org.apache.calcite.config.CalciteConnectionProperty; -import org.apache.calcite.jdbc.CalciteSchema; -import org.apache.calcite.jdbc.Driver; -import org.apache.calcite.plan.RelTraitDef; -import org.apache.calcite.prepare.CalciteCatalogReader; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.rel.RelRoot; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.runtime.Hook; -import org.apache.calcite.schema.SchemaPlus; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlOperatorTable; -import org.apache.calcite.sql.validate.SqlNameMatchers; -import org.apache.calcite.sql.validate.SqlValidator; -import org.apache.calcite.sql2rel.SqlRexConvertletTable; -import org.apache.calcite.sql2rel.SqlToRelConverter; -import org.apache.calcite.tools.FrameworkConfig; -import org.apache.calcite.tools.Frameworks; -import org.apache.calcite.tools.Programs; -import org.apache.calcite.tools.RelBuilder; -import org.apache.calcite.util.Util; - -import com.linkedin.coral.com.google.common.annotations.VisibleForTesting; +import com.linkedin.relocated.org.apache.calcite.config.CalciteConnectionConfig; +import com.linkedin.relocated.org.apache.calcite.config.CalciteConnectionConfigImpl; +import com.linkedin.relocated.org.apache.calcite.config.CalciteConnectionProperty; +import com.linkedin.relocated.org.apache.calcite.jdbc.CalciteSchema; +import com.linkedin.relocated.org.apache.calcite.jdbc.Driver; +import com.linkedin.relocated.org.apache.calcite.plan.RelTraitDef; +import com.linkedin.relocated.org.apache.calcite.prepare.CalciteCatalogReader; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.rel.RelRoot; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFactory; +import com.linkedin.relocated.org.apache.calcite.runtime.Hook; +import com.linkedin.relocated.org.apache.calcite.schema.SchemaPlus; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlNameMatchers; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidator; +import com.linkedin.relocated.org.apache.calcite.sql2rel.SqlRexConvertletTable; +import com.linkedin.relocated.org.apache.calcite.sql2rel.SqlToRelConverter; +import com.linkedin.relocated.org.apache.calcite.tools.FrameworkConfig; +import com.linkedin.relocated.org.apache.calcite.tools.Frameworks; +import com.linkedin.relocated.org.apache.calcite.tools.Programs; +import com.linkedin.relocated.org.apache.calcite.tools.RelBuilder; +import com.linkedin.relocated.org.apache.calcite.util.Util; import static com.google.common.base.Preconditions.checkNotNull; diff --git a/coral-common/src/main/java/com/linkedin/coral/common/TypeConverter.java b/coral-common/src/main/java/com/linkedin/coral/common/TypeConverter.java index d1dc558af..3313844bf 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/TypeConverter.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/TypeConverter.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -10,9 +10,10 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFactory; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; + import org.apache.hadoop.hive.common.type.HiveChar; import org.apache.hadoop.hive.serde.serdeConstants; import org.apache.hadoop.hive.serde2.typeinfo.*; diff --git a/coral-common/src/main/java/com/linkedin/coral/common/calcite/CalciteUtil.java b/coral-common/src/main/java/com/linkedin/coral/common/calcite/CalciteUtil.java index 2f1d1be94..f384ce154 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/calcite/CalciteUtil.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/calcite/CalciteUtil.java @@ -1,5 +1,5 @@ /** - * Copyright 2021-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2021-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,17 +7,18 @@ import java.util.*; -import org.apache.calcite.avatica.util.Casing; -import org.apache.calcite.sql.*; -import org.apache.calcite.sql.parser.SqlParseException; -import org.apache.calcite.sql.parser.SqlParser; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.validate.SqlConformanceEnum; +import com.linkedin.relocated.org.apache.calcite.avatica.util.Casing; +import com.linkedin.relocated.org.apache.calcite.sql.*; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParseException; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParser; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlConformanceEnum; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import static com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos.ZERO; import static java.lang.String.format; -import static org.apache.calcite.sql.parser.SqlParserPos.ZERO; public class CalciteUtil { diff --git a/coral-common/src/main/java/com/linkedin/coral/common/functions/CoralSqlUnnestOperator.java b/coral-common/src/main/java/com/linkedin/coral/common/functions/CoralSqlUnnestOperator.java index 49e13b242..729b28a8c 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/functions/CoralSqlUnnestOperator.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/functions/CoralSqlUnnestOperator.java @@ -1,18 +1,18 @@ /** - * Copyright 2022-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2022-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.common.functions; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.sql.SqlOperandCountRange; -import org.apache.calcite.sql.SqlOperatorBinding; -import org.apache.calcite.sql.SqlUnnestOperator; -import org.apache.calcite.sql.type.ArraySqlType; -import org.apache.calcite.sql.type.SqlOperandCountRanges; -import org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFactory; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperandCountRange; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperatorBinding; +import com.linkedin.relocated.org.apache.calcite.sql.SqlUnnestOperator; +import com.linkedin.relocated.org.apache.calcite.sql.type.ArraySqlType; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlOperandCountRanges; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; /** diff --git a/coral-common/src/main/java/com/linkedin/coral/common/functions/Function.java b/coral-common/src/main/java/com/linkedin/coral/common/functions/Function.java index 7d6e86a61..a5311dcd4 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/functions/Function.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/functions/Function.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,9 +7,9 @@ import java.util.List; -import org.apache.calcite.sql.*; +import com.linkedin.relocated.org.apache.calcite.sql.*; -import static org.apache.calcite.sql.parser.SqlParserPos.ZERO; +import static com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos.ZERO; /** diff --git a/coral-common/src/main/java/com/linkedin/coral/common/functions/FunctionFieldReferenceOperator.java b/coral-common/src/main/java/com/linkedin/coral/common/functions/FunctionFieldReferenceOperator.java index f947da078..a5c9a6b02 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/functions/FunctionFieldReferenceOperator.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/functions/FunctionFieldReferenceOperator.java @@ -1,28 +1,27 @@ /** - * Copyright 2018-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.common.functions; import com.google.common.base.Preconditions; - -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.sql.SqlBasicCall; -import org.apache.calcite.sql.SqlBinaryOperator; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlCharStringLiteral; -import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.SqlKind; -import org.apache.calcite.sql.SqlLiteral; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlWriter; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.OperandTypes; -import org.apache.calcite.sql.util.SqlBasicVisitor; -import org.apache.calcite.sql.util.SqlVisitor; -import org.apache.calcite.sql.validate.SqlValidator; -import org.apache.calcite.sql.validate.SqlValidatorScope; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.sql.SqlBasicCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlBinaryOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCharStringLiteral; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIdentifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlKind; +import com.linkedin.relocated.org.apache.calcite.sql.SqlLiteral; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlWriter; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.type.OperandTypes; +import com.linkedin.relocated.org.apache.calcite.sql.util.SqlBasicVisitor; +import com.linkedin.relocated.org.apache.calcite.sql.util.SqlVisitor; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidator; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidatorScope; /** diff --git a/coral-common/src/main/java/com/linkedin/coral/common/functions/FunctionReturnTypes.java b/coral-common/src/main/java/com/linkedin/coral/common/functions/FunctionReturnTypes.java index 2836b6901..2c1ab7d27 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/functions/FunctionReturnTypes.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/functions/FunctionReturnTypes.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -9,15 +9,13 @@ import java.util.stream.Collectors; import com.google.common.base.Preconditions; - -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.sql.type.ReturnTypes; -import org.apache.calcite.sql.type.SqlReturnTypeInference; -import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.calcite.sql.type.SqlTypeTransforms; - -import com.linkedin.coral.com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableList; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFactory; +import com.linkedin.relocated.org.apache.calcite.sql.type.ReturnTypes; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlReturnTypeInference; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeTransforms; /** diff --git a/coral-common/src/main/java/com/linkedin/coral/common/functions/GenericProjectFunction.java b/coral-common/src/main/java/com/linkedin/coral/common/functions/GenericProjectFunction.java index 966b86bc3..a7ab989be 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/functions/GenericProjectFunction.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/functions/GenericProjectFunction.java @@ -1,20 +1,20 @@ /** - * Copyright 2019-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.common.functions; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.sql.*; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.SqlOperandCountRanges; -import org.apache.calcite.sql.type.SqlOperandTypeChecker; -import org.apache.calcite.sql.type.SqlTypeFamily; -import org.apache.calcite.sql.validate.SqlUserDefinedFunction; -import org.apache.calcite.sql.validate.SqlValidator; -import org.apache.calcite.sql.validate.SqlValidatorScope; -import org.apache.calcite.util.Static; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.sql.*; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlOperandCountRanges; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlOperandTypeChecker; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeFamily; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlUserDefinedFunction; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidator; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidatorScope; +import com.linkedin.relocated.org.apache.calcite.util.Static; /** diff --git a/coral-common/src/main/java/com/linkedin/coral/common/functions/OperandTypeInference.java b/coral-common/src/main/java/com/linkedin/coral/common/functions/OperandTypeInference.java index 537818b12..71f4ac726 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/functions/OperandTypeInference.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/functions/OperandTypeInference.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,12 +8,11 @@ import java.util.List; import com.google.common.base.Preconditions; - -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.type.SqlOperandTypeInference; -import org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFactory; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlOperandTypeInference; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; public class OperandTypeInference { diff --git a/coral-common/src/main/java/com/linkedin/coral/common/functions/SameOperandTypeExceptFirstOperandChecker.java b/coral-common/src/main/java/com/linkedin/coral/common/functions/SameOperandTypeExceptFirstOperandChecker.java index 94218c04d..dda1e8b79 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/functions/SameOperandTypeExceptFirstOperandChecker.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/functions/SameOperandTypeExceptFirstOperandChecker.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -10,15 +10,14 @@ import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; - -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.sql.SqlCallBinding; -import org.apache.calcite.sql.SqlOperator; -import org.apache.calcite.sql.SqlOperatorBinding; -import org.apache.calcite.sql.SqlUtil; -import org.apache.calcite.sql.type.SameOperandTypeChecker; -import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.calcite.sql.type.SqlTypeUtil; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCallBinding; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperatorBinding; +import com.linkedin.relocated.org.apache.calcite.sql.SqlUtil; +import com.linkedin.relocated.org.apache.calcite.sql.type.SameOperandTypeChecker; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeUtil; /** diff --git a/coral-common/src/main/java/com/linkedin/coral/common/transformers/JsonTransformSqlCallTransformer.java b/coral-common/src/main/java/com/linkedin/coral/common/transformers/JsonTransformSqlCallTransformer.java index 98d5c9710..37f2bac9c 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/transformers/JsonTransformSqlCallTransformer.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/transformers/JsonTransformSqlCallTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2023-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -12,24 +12,23 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; +import com.google.common.base.Preconditions; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.google.gson.JsonPrimitive; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIdentifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlWriter; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.type.OperandTypes; +import com.linkedin.relocated.org.apache.calcite.sql.type.ReturnTypes; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlUserDefinedFunction; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlOperator; -import org.apache.calcite.sql.SqlWriter; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.OperandTypes; -import org.apache.calcite.sql.type.ReturnTypes; -import org.apache.calcite.sql.validate.SqlUserDefinedFunction; - -import com.linkedin.coral.com.google.common.base.Preconditions; import com.linkedin.coral.common.functions.FunctionReturnTypes; import static com.linkedin.coral.common.calcite.CalciteUtil.*; diff --git a/coral-common/src/main/java/com/linkedin/coral/common/transformers/OperatorRenameSqlCallTransformer.java b/coral-common/src/main/java/com/linkedin/coral/common/transformers/OperatorRenameSqlCallTransformer.java index 4e04a40bf..25261aa62 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/transformers/OperatorRenameSqlCallTransformer.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/transformers/OperatorRenameSqlCallTransformer.java @@ -1,14 +1,14 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.common.transformers; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlNodeList; -import org.apache.calcite.sql.SqlOperator; -import org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNodeList; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperator; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; /** diff --git a/coral-common/src/main/java/com/linkedin/coral/common/transformers/SourceOperatorMatchSqlCallTransformer.java b/coral-common/src/main/java/com/linkedin/coral/common/transformers/SourceOperatorMatchSqlCallTransformer.java index fe3356766..6380d0175 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/transformers/SourceOperatorMatchSqlCallTransformer.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/transformers/SourceOperatorMatchSqlCallTransformer.java @@ -1,11 +1,11 @@ /** - * Copyright 2023-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.common.transformers; -import org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; /** diff --git a/coral-common/src/main/java/com/linkedin/coral/common/transformers/SqlCallTransformer.java b/coral-common/src/main/java/com/linkedin/coral/common/transformers/SqlCallTransformer.java index e309313e8..ca53aa9a1 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/transformers/SqlCallTransformer.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/transformers/SqlCallTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,15 +8,14 @@ import java.util.List; import com.google.common.collect.ImmutableList; - -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlOperator; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.SqlReturnTypeInference; -import org.apache.calcite.sql.validate.SqlUserDefinedFunction; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIdentifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperator; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlReturnTypeInference; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlUserDefinedFunction; import com.linkedin.coral.common.utils.TypeDerivationUtil; diff --git a/coral-common/src/main/java/com/linkedin/coral/common/transformers/SqlCallTransformers.java b/coral-common/src/main/java/com/linkedin/coral/common/transformers/SqlCallTransformers.java index e438fd1aa..28b5edcd0 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/transformers/SqlCallTransformers.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/transformers/SqlCallTransformers.java @@ -1,5 +1,5 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,8 +8,7 @@ import java.util.Arrays; import com.google.common.collect.ImmutableList; - -import org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; /** diff --git a/coral-common/src/main/java/com/linkedin/coral/common/utils/RelDataTypeToHiveTypeStringConverter.java b/coral-common/src/main/java/com/linkedin/coral/common/utils/RelDataTypeToHiveTypeStringConverter.java index c5a652af2..f9f7729af 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/utils/RelDataTypeToHiveTypeStringConverter.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/utils/RelDataTypeToHiveTypeStringConverter.java @@ -1,5 +1,5 @@ /** - * Copyright 2022-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2022-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,11 +8,11 @@ import java.util.ArrayList; import java.util.List; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeField; -import org.apache.calcite.rel.type.RelRecordType; -import org.apache.calcite.sql.type.ArraySqlType; -import org.apache.calcite.sql.type.MapSqlType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeField; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelRecordType; +import com.linkedin.relocated.org.apache.calcite.sql.type.ArraySqlType; +import com.linkedin.relocated.org.apache.calcite.sql.type.MapSqlType; /** diff --git a/coral-common/src/main/java/com/linkedin/coral/common/utils/TypeDerivationUtil.java b/coral-common/src/main/java/com/linkedin/coral/common/utils/TypeDerivationUtil.java index 684ad668c..580297a46 100644 --- a/coral-common/src/main/java/com/linkedin/coral/common/utils/TypeDerivationUtil.java +++ b/coral-common/src/main/java/com/linkedin/coral/common/utils/TypeDerivationUtil.java @@ -1,5 +1,5 @@ /** - * Copyright 2023-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -9,15 +9,15 @@ import java.util.Collections; import java.util.List; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlNodeList; -import org.apache.calcite.sql.SqlSelect; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.util.SqlShuttle; -import org.apache.calcite.sql.validate.SqlValidator; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIdentifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNodeList; +import com.linkedin.relocated.org.apache.calcite.sql.SqlSelect; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.util.SqlShuttle; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidator; /** diff --git a/coral-common/src/test/java/com/linkedin/coral/common/utils/RelDataTypeToHiveDataTypeStringConverterTest.java b/coral-common/src/test/java/com/linkedin/coral/common/utils/RelDataTypeToHiveDataTypeStringConverterTest.java index 0ac88bcc9..42001be99 100644 --- a/coral-common/src/test/java/com/linkedin/coral/common/utils/RelDataTypeToHiveDataTypeStringConverterTest.java +++ b/coral-common/src/test/java/com/linkedin/coral/common/utils/RelDataTypeToHiveDataTypeStringConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -11,16 +11,16 @@ import com.google.common.collect.ImmutableMultimap; import com.google.common.collect.Multimap; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeField; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFieldImpl; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeSystem; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelRecordType; +import com.linkedin.relocated.org.apache.calcite.sql.type.ArraySqlType; +import com.linkedin.relocated.org.apache.calcite.sql.type.BasicSqlType; +import com.linkedin.relocated.org.apache.calcite.sql.type.MapSqlType; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeField; -import org.apache.calcite.rel.type.RelDataTypeFieldImpl; -import org.apache.calcite.rel.type.RelDataTypeSystem; -import org.apache.calcite.rel.type.RelRecordType; -import org.apache.calcite.sql.type.ArraySqlType; -import org.apache.calcite.sql.type.BasicSqlType; -import org.apache.calcite.sql.type.MapSqlType; -import org.apache.calcite.sql.type.SqlTypeName; import org.testng.annotations.Test; import static org.testng.Assert.*; diff --git a/coral-hive/build.gradle b/coral-hive/build.gradle index 8e2a2ff0a..4f0ff60e9 100644 --- a/coral-hive/build.gradle +++ b/coral-hive/build.gradle @@ -2,19 +2,21 @@ apply plugin: 'antlr' dependencies { antlr deps.'antlr' - compile project(path: ':coral-common') + implementation project(path: ':coral-common') + implementation(deps.'hive'.'hive-metastore') compile deps.'ivy' // required for hiveSQL parser code compile deps.'antlr-runtime' - testCompile(deps.'hive'.'hive-exec-core') { + testImplementation(deps.'hive'.'hive-exec-core') { exclude group: 'org.apache.avro', module: 'avro-tools' // These exclusions are required to prevent duplicate classes since we include // shaded jar above - exclude group: 'org.apache.calcite', module: 'calcite-core' - exclude group: 'org.apache.calcite', module: 'calcite-avatica' + // exclude group: 'org.apache.calcite', module: 'calcite-core' + // exclude group: 'org.apache.calcite', module: 'calcite-avatica' } + testImplementation("org.apache.commons:commons-lang3:3.17.0") testCompile deps.'hadoop'.'hadoop-mapreduce-client-core' testCompile deps.'kryo' diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/CoralConvertletTable.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/CoralConvertletTable.java index 774e81d0f..0d16becde 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/CoralConvertletTable.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/CoralConvertletTable.java @@ -1,20 +1,20 @@ /** - * Copyright 2018-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.hive.hive2rel; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rex.RexNode; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlDataTypeSpec; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.fun.SqlCastFunction; -import org.apache.calcite.sql2rel.ReflectiveConvertletTable; -import org.apache.calcite.sql2rel.SqlRexContext; -import org.apache.calcite.sql2rel.SqlRexConvertlet; -import org.apache.calcite.sql2rel.StandardConvertletTable; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rex.RexNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlDataTypeSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlCastFunction; +import com.linkedin.relocated.org.apache.calcite.sql2rel.ReflectiveConvertletTable; +import com.linkedin.relocated.org.apache.calcite.sql2rel.SqlRexContext; +import com.linkedin.relocated.org.apache.calcite.sql2rel.SqlRexConvertlet; +import com.linkedin.relocated.org.apache.calcite.sql2rel.StandardConvertletTable; import com.linkedin.coral.common.functions.FunctionFieldReferenceOperator; diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/DaliOperatorTable.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/DaliOperatorTable.java index c193eca1c..f8af2c685 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/DaliOperatorTable.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/DaliOperatorTable.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -10,14 +10,13 @@ import java.util.stream.Collectors; import com.google.common.collect.ImmutableList; - -import org.apache.calcite.sql.SqlFunctionCategory; -import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.SqlOperator; -import org.apache.calcite.sql.SqlOperatorTable; -import org.apache.calcite.sql.SqlSyntax; -import org.apache.calcite.sql.validate.SqlNameMatcher; -import org.apache.calcite.util.Util; +import com.linkedin.relocated.org.apache.calcite.sql.SqlFunctionCategory; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIdentifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.SqlSyntax; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlNameMatcher; +import com.linkedin.relocated.org.apache.calcite.util.Util; import com.linkedin.coral.common.functions.Function; import com.linkedin.coral.hive.hive2rel.functions.HiveFunctionResolver; diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveRexBuilder.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveRexBuilder.java index 941ba122d..49048d66c 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveRexBuilder.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveRexBuilder.java @@ -1,13 +1,13 @@ /** - * Copyright 2022-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2022-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.hive.hive2rel; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.rex.RexBuilder; -import org.apache.calcite.rex.RexNode; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFactory; +import com.linkedin.relocated.org.apache.calcite.rex.RexBuilder; +import com.linkedin.relocated.org.apache.calcite.rex.RexNode; public class HiveRexBuilder extends RexBuilder { diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveSqlConformance.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveSqlConformance.java index c6a711576..180516cb5 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveSqlConformance.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveSqlConformance.java @@ -1,13 +1,13 @@ /** - * Copyright 2021-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2021-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.hive.hive2rel; -import org.apache.calcite.sql.validate.SqlConformance; -import org.apache.calcite.sql.validate.SqlConformanceEnum; -import org.apache.calcite.sql.validate.SqlDelegatingConformance; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlConformance; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlConformanceEnum; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlDelegatingConformance; public class HiveSqlConformance extends SqlDelegatingConformance { diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveSqlNodeToCoralSqlNodeConverter.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveSqlNodeToCoralSqlNodeConverter.java index 8525a62f8..f7fc75b47 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveSqlNodeToCoralSqlNodeConverter.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveSqlNodeToCoralSqlNodeConverter.java @@ -1,14 +1,14 @@ /** - * Copyright 2017-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.hive.hive2rel; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.util.SqlShuttle; -import org.apache.calcite.sql.validate.SqlValidator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.util.SqlShuttle; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidator; import com.linkedin.coral.common.transformers.SqlCallTransformers; import com.linkedin.coral.common.utils.TypeDerivationUtil; diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveSqlToRelConverter.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveSqlToRelConverter.java index 42ee94f45..2a78c5829 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveSqlToRelConverter.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveSqlToRelConverter.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,31 +8,31 @@ import java.util.ArrayList; import java.util.List; -import org.apache.calcite.linq4j.Ord; -import org.apache.calcite.plan.Convention; -import org.apache.calcite.plan.RelOptCluster; -import org.apache.calcite.plan.RelOptTable; -import org.apache.calcite.plan.RelOptUtil; -import org.apache.calcite.prepare.Prepare; -import org.apache.calcite.rel.RelCollation; -import org.apache.calcite.rel.RelCollations; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.rel.RelRoot; -import org.apache.calcite.rel.core.Uncollect; -import org.apache.calcite.rel.logical.LogicalValues; -import org.apache.calcite.rel.metadata.JaninoRelMetadataProvider; -import org.apache.calcite.rel.metadata.RelMetadataQuery; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rex.RexNode; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlExplainFormat; -import org.apache.calcite.sql.SqlExplainLevel; -import org.apache.calcite.sql.SqlKind; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlUnnestOperator; -import org.apache.calcite.sql.validate.SqlValidator; -import org.apache.calcite.sql2rel.SqlRexConvertletTable; -import org.apache.calcite.sql2rel.SqlToRelConverter; +import com.linkedin.relocated.org.apache.calcite.linq4j.Ord; +import com.linkedin.relocated.org.apache.calcite.plan.Convention; +import com.linkedin.relocated.org.apache.calcite.plan.RelOptCluster; +import com.linkedin.relocated.org.apache.calcite.plan.RelOptTable; +import com.linkedin.relocated.org.apache.calcite.plan.RelOptUtil; +import com.linkedin.relocated.org.apache.calcite.prepare.Prepare; +import com.linkedin.relocated.org.apache.calcite.rel.RelCollation; +import com.linkedin.relocated.org.apache.calcite.rel.RelCollations; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.rel.RelRoot; +import com.linkedin.relocated.org.apache.calcite.rel.core.Uncollect; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalValues; +import com.linkedin.relocated.org.apache.calcite.rel.metadata.JaninoRelMetadataProvider; +import com.linkedin.relocated.org.apache.calcite.rel.metadata.RelMetadataQuery; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rex.RexNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlExplainFormat; +import com.linkedin.relocated.org.apache.calcite.sql.SqlExplainLevel; +import com.linkedin.relocated.org.apache.calcite.sql.SqlKind; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlUnnestOperator; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidator; +import com.linkedin.relocated.org.apache.calcite.sql2rel.SqlRexConvertletTable; +import com.linkedin.relocated.org.apache.calcite.sql2rel.SqlToRelConverter; import com.linkedin.coral.common.HiveUncollect; import com.linkedin.coral.common.functions.CoralSqlUnnestOperator; diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveSqlValidator.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveSqlValidator.java index 66ce83bb5..aa00bd10c 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveSqlValidator.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveSqlValidator.java @@ -1,23 +1,23 @@ /** - * Copyright 2017-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.hive.hive2rel; -import org.apache.calcite.adapter.java.JavaTypeFactory; -import org.apache.calcite.config.NullCollation; -import org.apache.calcite.prepare.CalciteCatalogReader; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.sql.SqlBasicCall; -import org.apache.calcite.sql.SqlInsert; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlOperatorTable; -import org.apache.calcite.sql.SqlUtil; -import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.calcite.sql.validate.SqlConformance; -import org.apache.calcite.sql.validate.SqlValidatorImpl; -import org.apache.calcite.sql.validate.SqlValidatorScope; +import com.linkedin.relocated.org.apache.calcite.adapter.java.JavaTypeFactory; +import com.linkedin.relocated.org.apache.calcite.config.NullCollation; +import com.linkedin.relocated.org.apache.calcite.prepare.CalciteCatalogReader; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.sql.SqlBasicCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlInsert; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.SqlUtil; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlConformance; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidatorImpl; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidatorScope; import com.linkedin.coral.common.functions.FunctionFieldReferenceOperator; diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveToRelConverter.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveToRelConverter.java index f19b61800..81b754ecc 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveToRelConverter.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveToRelConverter.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -9,16 +9,17 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.apache.calcite.adapter.java.JavaTypeFactory; -import org.apache.calcite.plan.RelOptCluster; -import org.apache.calcite.plan.volcano.VolcanoPlanner; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlOperatorTable; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.util.ChainedSqlOperatorTable; -import org.apache.calcite.sql.validate.SqlValidator; -import org.apache.calcite.sql2rel.SqlRexConvertletTable; -import org.apache.calcite.sql2rel.SqlToRelConverter; +import com.linkedin.relocated.org.apache.calcite.adapter.java.JavaTypeFactory; +import com.linkedin.relocated.org.apache.calcite.plan.RelOptCluster; +import com.linkedin.relocated.org.apache.calcite.plan.volcano.VolcanoPlanner; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.util.ChainedSqlOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidator; +import com.linkedin.relocated.org.apache.calcite.sql2rel.SqlRexConvertletTable; +import com.linkedin.relocated.org.apache.calcite.sql2rel.SqlToRelConverter; + import org.apache.hadoop.hive.metastore.api.Table; import com.linkedin.coral.common.FuzzyUnionSqlRewriter; diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveViewExpander.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveViewExpander.java index ac81842a9..797e3a1ea 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveViewExpander.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/HiveViewExpander.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -10,12 +10,11 @@ import javax.annotation.Nonnull; import com.google.common.base.Preconditions; - -import org.apache.calcite.plan.RelOptTable; -import org.apache.calcite.rel.RelRoot; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.util.Util; +import com.linkedin.relocated.org.apache.calcite.plan.RelOptTable; +import com.linkedin.relocated.org.apache.calcite.rel.RelRoot; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.util.Util; import com.linkedin.coral.common.FuzzyUnionSqlRewriter; diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/CoalesceStructUtility.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/CoalesceStructUtility.java index e96bfa406..2de8a6361 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/CoalesceStructUtility.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/CoalesceStructUtility.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -11,13 +11,12 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; - -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.rel.type.RelDataTypeField; -import org.apache.calcite.sql.type.ReturnTypes; -import org.apache.calcite.sql.type.SqlReturnTypeInference; -import org.apache.calcite.sql.type.SqlTypeTransforms; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFactory; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeField; +import com.linkedin.relocated.org.apache.calcite.sql.type.ReturnTypes; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlReturnTypeInference; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeTransforms; /** diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/CoralINOperator.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/CoralINOperator.java index e09253867..30b8fdc7f 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/CoralINOperator.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/CoralINOperator.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -9,33 +9,32 @@ import java.util.List; import com.google.common.collect.ImmutableList; - -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.rel.type.RelDataTypeField; -import org.apache.calcite.sql.ExplicitOperatorBinding; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlCallBinding; -import org.apache.calcite.sql.SqlKind; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlNodeList; -import org.apache.calcite.sql.SqlOperandCountRange; -import org.apache.calcite.sql.SqlSpecialOperator; -import org.apache.calcite.sql.SqlWriter; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.type.ComparableOperandTypeChecker; -import org.apache.calcite.sql.type.InferTypes; -import org.apache.calcite.sql.type.OperandTypes; -import org.apache.calcite.sql.type.ReturnTypes; -import org.apache.calcite.sql.type.SqlOperandCountRanges; -import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.calcite.sql.type.SqlTypeUtil; -import org.apache.calcite.sql.validate.SqlValidator; -import org.apache.calcite.sql.validate.SqlValidatorImpl; -import org.apache.calcite.sql.validate.SqlValidatorScope; - -import static org.apache.calcite.sql.parser.SqlParserPos.ZERO; -import static org.apache.calcite.util.Static.*; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFactory; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeField; +import com.linkedin.relocated.org.apache.calcite.sql.ExplicitOperatorBinding; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCallBinding; +import com.linkedin.relocated.org.apache.calcite.sql.SqlKind; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNodeList; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperandCountRange; +import com.linkedin.relocated.org.apache.calcite.sql.SqlSpecialOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlWriter; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.type.ComparableOperandTypeChecker; +import com.linkedin.relocated.org.apache.calcite.sql.type.InferTypes; +import com.linkedin.relocated.org.apache.calcite.sql.type.OperandTypes; +import com.linkedin.relocated.org.apache.calcite.sql.type.ReturnTypes; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlOperandCountRanges; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeUtil; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidator; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidatorImpl; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidatorScope; + +import static com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos.ZERO; +import static com.linkedin.relocated.org.apache.calcite.util.Static.*; /** diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveExplodeOperator.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveExplodeOperator.java index dbfe5834f..13a5f9422 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveExplodeOperator.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveExplodeOperator.java @@ -1,19 +1,19 @@ /** - * Copyright 2018-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.hive.hive2rel.functions; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.sql.SqlCallBinding; -import org.apache.calcite.sql.SqlOperandCountRange; -import org.apache.calcite.sql.SqlOperatorBinding; -import org.apache.calcite.sql.SqlUnnestOperator; -import org.apache.calcite.sql.type.ArraySqlType; -import org.apache.calcite.sql.type.MapSqlType; -import org.apache.calcite.sql.type.SqlOperandCountRanges; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFactory; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCallBinding; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperandCountRange; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperatorBinding; +import com.linkedin.relocated.org.apache.calcite.sql.SqlUnnestOperator; +import com.linkedin.relocated.org.apache.calcite.sql.type.ArraySqlType; +import com.linkedin.relocated.org.apache.calcite.sql.type.MapSqlType; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlOperandCountRanges; /** diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveFunction.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveFunction.java index b80b69b9f..89dfda49c 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveFunction.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveFunction.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -9,20 +9,19 @@ import java.util.List; import com.google.common.collect.ImmutableList; - -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlLiteral; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlNodeList; -import org.apache.calcite.sql.SqlSelect; -import org.apache.calcite.sql.fun.SqlCase; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.util.Util; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlLiteral; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNodeList; +import com.linkedin.relocated.org.apache.calcite.sql.SqlSelect; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlCase; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.util.Util; import com.linkedin.coral.common.functions.Function; import static com.google.common.base.Preconditions.*; -import static org.apache.calcite.sql.parser.SqlParserPos.*; +import static com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos.*; public class HiveFunction { diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveFunctionResolver.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveFunctionResolver.java index 4683f3059..8b21c3168 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveFunctionResolver.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveFunctionResolver.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -15,29 +15,30 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; -import org.apache.calcite.sql.SqlBinaryOperator; -import org.apache.calcite.sql.SqlFunctionCategory; -import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.SqlOperator; -import org.apache.calcite.sql.SqlPrefixOperator; -import org.apache.calcite.sql.SqlSpecialOperator; -import org.apache.calcite.sql.SqlUnresolvedFunction; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.type.SqlOperandTypeChecker; -import org.apache.calcite.sql.type.SqlTypeFamily; -import org.apache.calcite.sql.validate.SqlUserDefinedFunction; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import com.linkedin.relocated.org.apache.calcite.sql.SqlBinaryOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlFunctionCategory; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIdentifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlPrefixOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlSpecialOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlUnresolvedFunction; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlOperandTypeChecker; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeFamily; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlUserDefinedFunction; + import org.apache.hadoop.hive.metastore.api.Table; -import com.linkedin.coral.com.google.common.base.Preconditions; -import com.linkedin.coral.com.google.common.collect.ImmutableList; import com.linkedin.coral.common.HiveTable; import com.linkedin.coral.common.functions.Function; import com.linkedin.coral.common.functions.FunctionRegistry; import com.linkedin.coral.common.functions.UnknownSqlFunctionException; import static com.google.common.base.Preconditions.*; -import static org.apache.calcite.sql.parser.SqlParserPos.*; -import static org.apache.calcite.sql.type.OperandTypes.*; +import static com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos.*; +import static com.linkedin.relocated.org.apache.calcite.sql.type.OperandTypes.*; /** diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveGenericUDFReturnTypeInference.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveGenericUDFReturnTypeInference.java index 9619d86ef..3bf0a698b 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveGenericUDFReturnTypeInference.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveGenericUDFReturnTypeInference.java @@ -1,5 +1,5 @@ /** - * Copyright 2020-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2020-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -14,10 +14,11 @@ import java.net.URLClassLoader; import java.util.List; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.sql.SqlOperatorBinding; -import org.apache.calcite.sql.type.SqlReturnTypeInference; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFactory; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperatorBinding; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlReturnTypeInference; + import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo; import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils; diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveJsonTupleOperator.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveJsonTupleOperator.java index b9954f744..2b74a4cb8 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveJsonTupleOperator.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveJsonTupleOperator.java @@ -1,24 +1,24 @@ /** - * Copyright 2021 LinkedIn Corporation. All rights reserved. + * Copyright 2021-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.hive.hive2rel.functions; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlCallBinding; -import org.apache.calcite.sql.SqlFunctionalOperator; -import org.apache.calcite.sql.SqlKind; -import org.apache.calcite.sql.SqlOperandCountRange; -import org.apache.calcite.sql.SqlOperatorBinding; -import org.apache.calcite.sql.SqlWriter; -import org.apache.calcite.sql.type.SqlOperandCountRanges; -import org.apache.calcite.sql.type.SqlOperandTypeChecker; -import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.calcite.sql.validate.SqlValidator; -import org.apache.calcite.util.Static; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFactory; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCallBinding; +import com.linkedin.relocated.org.apache.calcite.sql.SqlFunctionalOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlKind; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperandCountRange; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperatorBinding; +import com.linkedin.relocated.org.apache.calcite.sql.SqlWriter; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlOperandCountRanges; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlOperandTypeChecker; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidator; +import com.linkedin.relocated.org.apache.calcite.util.Static; public class HiveJsonTupleOperator extends SqlFunctionalOperator { diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveNamedStructFunction.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveNamedStructFunction.java index 89388f76f..fcd770932 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveNamedStructFunction.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveNamedStructFunction.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -9,22 +9,22 @@ import java.util.List; import java.util.Map; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlCallBinding; -import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlOperandCountRange; -import org.apache.calcite.sql.SqlOperatorBinding; -import org.apache.calcite.sql.SqlUtil; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.SqlOperandCountRanges; -import org.apache.calcite.sql.type.SqlOperandTypeChecker; -import org.apache.calcite.sql.type.SqlTypeFamily; -import org.apache.calcite.sql.validate.SqlUserDefinedFunction; -import org.apache.calcite.sql.validate.SqlValidator; -import org.apache.calcite.util.Pair; -import org.apache.calcite.util.Static; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCallBinding; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIdentifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperandCountRange; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperatorBinding; +import com.linkedin.relocated.org.apache.calcite.sql.SqlUtil; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlOperandCountRanges; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlOperandTypeChecker; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeFamily; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlUserDefinedFunction; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidator; +import com.linkedin.relocated.org.apache.calcite.util.Pair; +import com.linkedin.relocated.org.apache.calcite.util.Static; import static com.google.common.base.Preconditions.*; diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HivePosExplodeOperator.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HivePosExplodeOperator.java index c39d12116..3614b9b4b 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HivePosExplodeOperator.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HivePosExplodeOperator.java @@ -1,19 +1,19 @@ /** - * Copyright 2018-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.hive.hive2rel.functions; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.sql.SqlCallBinding; -import org.apache.calcite.sql.SqlOperandCountRange; -import org.apache.calcite.sql.SqlOperatorBinding; -import org.apache.calcite.sql.SqlUnnestOperator; -import org.apache.calcite.sql.type.ArraySqlType; -import org.apache.calcite.sql.type.SqlOperandCountRanges; -import org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFactory; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCallBinding; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperandCountRange; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperatorBinding; +import com.linkedin.relocated.org.apache.calcite.sql.SqlUnnestOperator; +import com.linkedin.relocated.org.apache.calcite.sql.type.ArraySqlType; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlOperandCountRanges; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; /** diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveRLikeOperator.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveRLikeOperator.java index 40db40bfb..852ecf863 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveRLikeOperator.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveRLikeOperator.java @@ -1,21 +1,21 @@ /** - * Copyright 2018-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.hive.hive2rel.functions; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlCallBinding; -import org.apache.calcite.sql.SqlKind; -import org.apache.calcite.sql.SqlOperandCountRange; -import org.apache.calcite.sql.SqlSpecialOperator; -import org.apache.calcite.sql.SqlWriter; -import org.apache.calcite.sql.type.InferTypes; -import org.apache.calcite.sql.type.OperandTypes; -import org.apache.calcite.sql.type.ReturnTypes; -import org.apache.calcite.sql.type.SqlOperandCountRanges; -import org.apache.calcite.sql.type.SqlTypeUtil; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCallBinding; +import com.linkedin.relocated.org.apache.calcite.sql.SqlKind; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperandCountRange; +import com.linkedin.relocated.org.apache.calcite.sql.SqlSpecialOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlWriter; +import com.linkedin.relocated.org.apache.calcite.sql.type.InferTypes; +import com.linkedin.relocated.org.apache.calcite.sql.type.OperandTypes; +import com.linkedin.relocated.org.apache.calcite.sql.type.ReturnTypes; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlOperandCountRanges; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeUtil; public class HiveRLikeOperator extends SqlSpecialOperator { diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveReflectOperator.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveReflectOperator.java index c5c03a063..08fcd4f7d 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveReflectOperator.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/HiveReflectOperator.java @@ -1,24 +1,25 @@ /** - * Copyright 2018-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.hive.hive2rel.functions; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.sql.SqlCallBinding; -import org.apache.calcite.sql.SqlFunctionalOperator; -import org.apache.calcite.sql.SqlKind; -import org.apache.calcite.sql.SqlOperandCountRange; -import org.apache.calcite.sql.SqlOperatorBinding; -import org.apache.calcite.sql.type.SqlOperandCountRanges; -import org.apache.calcite.sql.type.SqlTypeName; +import com.google.common.collect.ImmutableList; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCallBinding; +import com.linkedin.relocated.org.apache.calcite.sql.SqlFunctionalOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlKind; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperandCountRange; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperatorBinding; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlOperandCountRanges; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; + import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory; import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo; import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils; -import com.linkedin.coral.com.google.common.collect.ImmutableList; import com.linkedin.coral.common.TypeConverter; diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/OrdinalReturnTypeInferenceV2.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/OrdinalReturnTypeInferenceV2.java index f41079ab1..e8527314a 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/OrdinalReturnTypeInferenceV2.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/OrdinalReturnTypeInferenceV2.java @@ -1,11 +1,11 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.hive.hive2rel.functions; -import org.apache.calcite.sql.type.OrdinalReturnTypeInference; +import com.linkedin.relocated.org.apache.calcite.sql.type.OrdinalReturnTypeInference; /** diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/StaticHiveFunctionRegistry.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/StaticHiveFunctionRegistry.java index 8205814ed..1ab08520d 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/StaticHiveFunctionRegistry.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/StaticHiveFunctionRegistry.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -14,22 +14,21 @@ import java.util.stream.Collectors; import com.google.common.base.Preconditions; +import com.google.common.collect.HashMultimap; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMultimap; +import com.google.common.collect.Multimap; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFactory; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCallBinding; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIdentifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperandCountRange; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperator; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.type.*; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlUserDefinedFunction; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.sql.SqlCallBinding; -import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.SqlOperandCountRange; -import org.apache.calcite.sql.SqlOperator; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.*; -import org.apache.calcite.sql.validate.SqlUserDefinedFunction; - -import com.linkedin.coral.com.google.common.collect.HashMultimap; -import com.linkedin.coral.com.google.common.collect.ImmutableList; -import com.linkedin.coral.com.google.common.collect.ImmutableMultimap; -import com.linkedin.coral.com.google.common.collect.Multimap; import com.linkedin.coral.common.functions.CoralSqlUnnestOperator; import com.linkedin.coral.common.functions.Function; import com.linkedin.coral.common.functions.FunctionRegistry; @@ -40,10 +39,10 @@ import static com.linkedin.coral.hive.hive2rel.functions.CoalesceStructUtility.*; import static com.linkedin.coral.hive.hive2rel.functions.TimestampFromUnixtime.TIMESTAMP_FROM_UNIXTIME; -import static org.apache.calcite.sql.fun.SqlLibraryOperators.*; -import static org.apache.calcite.sql.fun.SqlStdOperatorTable.*; -import static org.apache.calcite.sql.type.OperandTypes.*; -import static org.apache.calcite.sql.type.ReturnTypes.*; +import static com.linkedin.relocated.org.apache.calcite.sql.fun.SqlLibraryOperators.*; +import static com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable.*; +import static com.linkedin.relocated.org.apache.calcite.sql.type.OperandTypes.*; +import static com.linkedin.relocated.org.apache.calcite.sql.type.ReturnTypes.*; /** diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/TimestampFromUnixtime.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/TimestampFromUnixtime.java index 6edbcb7d7..11dc333f0 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/TimestampFromUnixtime.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/TimestampFromUnixtime.java @@ -1,27 +1,27 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.hive.hive2rel.functions; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlCallBinding; -import org.apache.calcite.sql.SqlFunction; -import org.apache.calcite.sql.SqlFunctionCategory; -import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.SqlLiteral; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlOperandCountRange; -import org.apache.calcite.sql.SqlUtil; -import org.apache.calcite.sql.SqlWriter; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.OperandTypes; -import org.apache.calcite.sql.type.SqlOperandCountRanges; -import org.apache.calcite.sql.type.SqlTypeFamily; -import org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCallBinding; +import com.linkedin.relocated.org.apache.calcite.sql.SqlFunction; +import com.linkedin.relocated.org.apache.calcite.sql.SqlFunctionCategory; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIdentifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlLiteral; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperandCountRange; +import com.linkedin.relocated.org.apache.calcite.sql.SqlUtil; +import com.linkedin.relocated.org.apache.calcite.sql.SqlWriter; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.type.OperandTypes; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlOperandCountRanges; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeFamily; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; -import static org.apache.calcite.sql.type.ReturnTypes.explicit; +import static com.linkedin.relocated.org.apache.calcite.sql.type.ReturnTypes.explicit; public class TimestampFromUnixtime extends SqlFunction { diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/VersionedSqlUserDefinedFunction.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/VersionedSqlUserDefinedFunction.java index 0d962736a..5fe6b3609 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/VersionedSqlUserDefinedFunction.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/functions/VersionedSqlUserDefinedFunction.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,25 +8,23 @@ import java.util.List; import java.util.Map; +import com.google.common.base.CaseFormat; +import com.google.common.base.Converter; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; - -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.schema.Function; -import org.apache.calcite.sql.SqlBasicCall; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlFunctionCategory; -import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.SqlOperandTypeChecker; -import org.apache.calcite.sql.type.SqlOperandTypeInference; -import org.apache.calcite.sql.type.SqlReturnTypeInference; -import org.apache.calcite.sql.validate.SqlUserDefinedFunction; -import org.apache.calcite.sql.validate.SqlValidator; -import org.apache.calcite.sql.validate.SqlValidatorScope; - -import com.linkedin.coral.com.google.common.base.CaseFormat; -import com.linkedin.coral.com.google.common.base.Converter; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.schema.Function; +import com.linkedin.relocated.org.apache.calcite.sql.SqlBasicCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlFunctionCategory; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIdentifier; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlOperandTypeChecker; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlOperandTypeInference; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlReturnTypeInference; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlUserDefinedFunction; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidator; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidatorScope; /** diff --git a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java index bc0a435bd..a678c2cfb 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java +++ b/coral-hive/src/main/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilder.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -15,36 +15,37 @@ import javax.annotation.Nullable; -import org.apache.calcite.avatica.util.TimeUnit; -import org.apache.calcite.sql.JoinConditionType; -import org.apache.calcite.sql.JoinType; -import org.apache.calcite.sql.SqlAsOperator; -import org.apache.calcite.sql.SqlBasicCall; -import org.apache.calcite.sql.SqlBasicTypeNameSpec; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlDataTypeSpec; -import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.SqlIntervalQualifier; -import org.apache.calcite.sql.SqlJoin; -import org.apache.calcite.sql.SqlKind; -import org.apache.calcite.sql.SqlLateralOperator; -import org.apache.calcite.sql.SqlLiteral; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlNodeList; -import org.apache.calcite.sql.SqlOperator; -import org.apache.calcite.sql.SqlSelect; -import org.apache.calcite.sql.SqlSelectKeyword; -import org.apache.calcite.sql.SqlTypeNameSpec; -import org.apache.calcite.sql.SqlWindow; -import org.apache.calcite.sql.SqlWith; -import org.apache.calcite.sql.SqlWithItem; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.SqlTypeName; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Iterables; +import com.linkedin.relocated.org.apache.calcite.avatica.util.TimeUnit; +import com.linkedin.relocated.org.apache.calcite.sql.JoinConditionType; +import com.linkedin.relocated.org.apache.calcite.sql.JoinType; +import com.linkedin.relocated.org.apache.calcite.sql.SqlAsOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlBasicCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlBasicTypeNameSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlDataTypeSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIdentifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIntervalQualifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlJoin; +import com.linkedin.relocated.org.apache.calcite.sql.SqlKind; +import com.linkedin.relocated.org.apache.calcite.sql.SqlLateralOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlLiteral; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNodeList; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlSelect; +import com.linkedin.relocated.org.apache.calcite.sql.SqlSelectKeyword; +import com.linkedin.relocated.org.apache.calcite.sql.SqlTypeNameSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlWindow; +import com.linkedin.relocated.org.apache.calcite.sql.SqlWith; +import com.linkedin.relocated.org.apache.calcite.sql.SqlWithItem; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; + import org.apache.hadoop.hive.metastore.api.Table; -import com.linkedin.coral.com.google.common.collect.ImmutableList; -import com.linkedin.coral.com.google.common.collect.Iterables; import com.linkedin.coral.common.functions.CoralSqlUnnestOperator; import com.linkedin.coral.common.functions.Function; import com.linkedin.coral.common.functions.FunctionFieldReferenceOperator; @@ -61,8 +62,8 @@ import com.linkedin.coral.hive.hive2rel.parsetree.parser.ParseException; import static com.google.common.base.Preconditions.checkState; +import static com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos.ZERO; import static java.lang.String.format; -import static org.apache.calcite.sql.parser.SqlParserPos.ZERO; /** diff --git a/coral-hive/src/main/java/com/linkedin/coral/transformers/CoralRelToSqlNodeConverter.java b/coral-hive/src/main/java/com/linkedin/coral/transformers/CoralRelToSqlNodeConverter.java index 111bfcaa7..928bb6f23 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/transformers/CoralRelToSqlNodeConverter.java +++ b/coral-hive/src/main/java/com/linkedin/coral/transformers/CoralRelToSqlNodeConverter.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -10,44 +10,44 @@ import java.util.List; import java.util.Map; -import org.apache.calcite.config.NullCollation; -import org.apache.calcite.rel.BiRel; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.rel.core.Correlate; -import org.apache.calcite.rel.core.Join; -import org.apache.calcite.rel.core.JoinRelType; -import org.apache.calcite.rel.core.Project; -import org.apache.calcite.rel.core.TableScan; -import org.apache.calcite.rel.core.Uncollect; -import org.apache.calcite.rel.core.Values; -import org.apache.calcite.rel.logical.LogicalTableFunctionScan; -import org.apache.calcite.rel.rel2sql.RelToSqlConverter; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeField; -import org.apache.calcite.rex.RexCall; -import org.apache.calcite.rex.RexCorrelVariable; -import org.apache.calcite.rex.RexFieldAccess; -import org.apache.calcite.rex.RexNode; -import org.apache.calcite.rex.RexProgram; -import org.apache.calcite.sql.JoinConditionType; -import org.apache.calcite.sql.JoinType; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlDialect; -import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.SqlJoin; -import org.apache.calcite.sql.SqlKind; -import org.apache.calcite.sql.SqlLateralOperator; -import org.apache.calcite.sql.SqlLiteral; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlNodeList; -import org.apache.calcite.sql.SqlOperator; -import org.apache.calcite.sql.SqlUtil; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.SqlTypeName; - -import com.linkedin.coral.com.google.common.collect.ImmutableList; -import com.linkedin.coral.com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.linkedin.relocated.org.apache.calcite.config.NullCollation; +import com.linkedin.relocated.org.apache.calcite.rel.BiRel; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.rel.core.Correlate; +import com.linkedin.relocated.org.apache.calcite.rel.core.Join; +import com.linkedin.relocated.org.apache.calcite.rel.core.JoinRelType; +import com.linkedin.relocated.org.apache.calcite.rel.core.Project; +import com.linkedin.relocated.org.apache.calcite.rel.core.TableScan; +import com.linkedin.relocated.org.apache.calcite.rel.core.Uncollect; +import com.linkedin.relocated.org.apache.calcite.rel.core.Values; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalTableFunctionScan; +import com.linkedin.relocated.org.apache.calcite.rel.rel2sql.RelToSqlConverter; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeField; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexCorrelVariable; +import com.linkedin.relocated.org.apache.calcite.rex.RexFieldAccess; +import com.linkedin.relocated.org.apache.calcite.rex.RexNode; +import com.linkedin.relocated.org.apache.calcite.rex.RexProgram; +import com.linkedin.relocated.org.apache.calcite.sql.JoinConditionType; +import com.linkedin.relocated.org.apache.calcite.sql.JoinType; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlDialect; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIdentifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlJoin; +import com.linkedin.relocated.org.apache.calcite.sql.SqlKind; +import com.linkedin.relocated.org.apache.calcite.sql.SqlLateralOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlLiteral; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNodeList; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlUtil; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; + import com.linkedin.coral.common.functions.CoralSqlUnnestOperator; import com.linkedin.coral.common.functions.FunctionFieldReferenceOperator; diff --git a/coral-hive/src/main/java/com/linkedin/coral/transformers/ShiftArrayIndexTransformer.java b/coral-hive/src/main/java/com/linkedin/coral/transformers/ShiftArrayIndexTransformer.java index 793210186..a551d7e77 100644 --- a/coral-hive/src/main/java/com/linkedin/coral/transformers/ShiftArrayIndexTransformer.java +++ b/coral-hive/src/main/java/com/linkedin/coral/transformers/ShiftArrayIndexTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2022-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2022-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,13 +7,13 @@ import java.math.BigDecimal; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlNumericLiteral; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.ArraySqlType; -import org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNumericLiteral; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.type.ArraySqlType; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; import com.linkedin.coral.common.transformers.SqlCallTransformer; import com.linkedin.coral.common.utils.TypeDerivationUtil; diff --git a/coral-hive/src/test/java/com/linkedin/coral/common/ToRelConverterTestUtils.java b/coral-hive/src/test/java/com/linkedin/coral/common/ToRelConverterTestUtils.java index d2f4aa702..7c3ed04fc 100644 --- a/coral-hive/src/test/java/com/linkedin/coral/common/ToRelConverterTestUtils.java +++ b/coral-hive/src/test/java/com/linkedin/coral/common/ToRelConverterTestUtils.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,12 +7,13 @@ import java.io.IOException; -import org.apache.calcite.plan.RelOptUtil; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.rel.rel2sql.RelToSqlConverter; -import org.apache.calcite.sql.SqlDialect; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.tools.RelBuilder; +import com.linkedin.relocated.org.apache.calcite.plan.RelOptUtil; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.rel.rel2sql.RelToSqlConverter; +import com.linkedin.relocated.org.apache.calcite.sql.SqlDialect; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.tools.RelBuilder; + import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.IMetaStoreClient; import org.apache.hadoop.hive.metastore.api.MetaException; diff --git a/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/FuzzyUnionTest.java b/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/FuzzyUnionTest.java index 6d07c5659..77571a68a 100644 --- a/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/FuzzyUnionTest.java +++ b/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/FuzzyUnionTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,7 +8,8 @@ import java.io.File; import java.io.IOException; -import org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; + import org.apache.commons.io.FileUtils; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.api.MetaException; diff --git a/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/HiveOperatorsTest.java b/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/HiveOperatorsTest.java index 83930a33b..5a538d4df 100644 --- a/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/HiveOperatorsTest.java +++ b/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/HiveOperatorsTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,7 +8,8 @@ import java.io.File; import java.io.IOException; -import org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; + import org.apache.commons.io.FileUtils; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.api.MetaException; diff --git a/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/HiveSchemaTest.java b/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/HiveSchemaTest.java index 3984118ef..884409a4f 100644 --- a/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/HiveSchemaTest.java +++ b/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/HiveSchemaTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -10,8 +10,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; +import com.linkedin.relocated.org.apache.calcite.schema.Schema; -import org.apache.calcite.schema.Schema; import org.apache.commons.io.FileUtils; import org.apache.hadoop.hive.conf.HiveConf; import org.testng.annotations.AfterTest; diff --git a/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/HiveTableTest.java b/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/HiveTableTest.java index 8c26819f7..cb7fc7786 100644 --- a/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/HiveTableTest.java +++ b/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/HiveTableTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -11,14 +11,14 @@ import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; +import com.linkedin.relocated.org.apache.calcite.jdbc.JavaTypeFactoryImpl; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFactory; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeField; +import com.linkedin.relocated.org.apache.calcite.schema.Schema; +import com.linkedin.relocated.org.apache.calcite.schema.Table; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; -import org.apache.calcite.jdbc.JavaTypeFactoryImpl; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.rel.type.RelDataTypeField; -import org.apache.calcite.schema.Schema; -import org.apache.calcite.schema.Table; -import org.apache.calcite.sql.type.SqlTypeName; import org.apache.commons.io.FileUtils; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.IMetaStoreClient; diff --git a/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/HiveToRelConverterTest.java b/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/HiveToRelConverterTest.java index d15240751..c80652b42 100644 --- a/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/HiveToRelConverterTest.java +++ b/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/HiveToRelConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -12,14 +12,14 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import com.linkedin.relocated.org.apache.calcite.plan.RelOptUtil; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.type.ReturnTypes; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeFamily; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.tools.RelBuilder; -import org.apache.calcite.plan.RelOptUtil; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.type.ReturnTypes; -import org.apache.calcite.sql.type.SqlTypeFamily; -import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.calcite.tools.RelBuilder; import org.apache.commons.io.FileUtils; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.api.MetaException; @@ -33,7 +33,7 @@ import com.linkedin.coral.hive.hive2rel.functions.StaticHiveFunctionRegistry; import static com.linkedin.coral.common.ToRelConverterTestUtils.*; -import static org.apache.calcite.sql.type.OperandTypes.*; +import static com.linkedin.relocated.org.apache.calcite.sql.type.OperandTypes.*; import static org.testng.Assert.*; diff --git a/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/LateralViewTest.java b/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/LateralViewTest.java index 1e5d85cb6..ad1402cbf 100644 --- a/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/LateralViewTest.java +++ b/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/LateralViewTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,10 +8,12 @@ import java.io.File; import java.io.IOException; -import org.apache.calcite.plan.RelOptUtil; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.sql.type.SqlTypeFamily; -import org.apache.calcite.sql.type.SqlTypeName; +import com.google.common.collect.ImmutableList; +import com.linkedin.relocated.org.apache.calcite.plan.RelOptUtil; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeFamily; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; + import org.apache.commons.io.FileUtils; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.api.MetaException; @@ -20,13 +22,12 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import com.linkedin.coral.com.google.common.collect.ImmutableList; import com.linkedin.coral.common.HiveMscAdapter; import com.linkedin.coral.common.ToRelConverterTestUtils; import com.linkedin.coral.hive.hive2rel.functions.StaticHiveFunctionRegistry; import static com.linkedin.coral.common.ToRelConverterTestUtils.*; -import static org.apache.calcite.sql.type.OperandTypes.*; +import static com.linkedin.relocated.org.apache.calcite.sql.type.OperandTypes.*; import static org.testng.Assert.*; diff --git a/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/NamedStructTest.java b/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/NamedStructTest.java index 12c4410e2..828642127 100644 --- a/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/NamedStructTest.java +++ b/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/NamedStructTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,8 +8,9 @@ import java.io.File; import java.io.IOException; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.runtime.CalciteContextException; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.runtime.CalciteContextException; + import org.apache.commons.io.FileUtils; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.api.MetaException; diff --git a/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/functions/CoalesceStructUtilityTest.java b/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/functions/CoalesceStructUtilityTest.java index c624b18c3..fd7678426 100644 --- a/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/functions/CoalesceStructUtilityTest.java +++ b/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/functions/CoalesceStructUtilityTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -13,10 +13,10 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFactory; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.sql.type.SqlTypeName; import org.apache.commons.io.FileUtils; import org.apache.hadoop.hive.conf.HiveConf; import org.testng.Assert; diff --git a/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilderTest.java b/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilderTest.java index 8fb24e230..67accae27 100644 --- a/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilderTest.java +++ b/coral-hive/src/test/java/com/linkedin/coral/hive/hive2rel/parsetree/ParseTreeBuilderTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -11,12 +11,12 @@ import java.util.List; import com.google.common.collect.ImmutableList; +import com.linkedin.relocated.org.apache.calcite.avatica.util.Casing; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParseException; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParser; -import org.apache.calcite.avatica.util.Casing; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.parser.SqlParseException; -import org.apache.calcite.sql.parser.SqlParser; import org.apache.commons.io.FileUtils; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.api.MetaException; diff --git a/coral-incremental/build.gradle b/coral-incremental/build.gradle index ddc2a85b5..0fa86e7ff 100644 --- a/coral-incremental/build.gradle +++ b/coral-incremental/build.gradle @@ -1,11 +1,10 @@ dependencies { + api (deps.'linkedin-calcite-core') compile project(':coral-hive') - testCompile(deps.'hive'.'hive-exec-core') { - // This exclusion is required to prevent duplicate classes since we include - // shaded 'calcite-core' transitively - exclude group: 'org.apache.calcite', module: 'calcite-core' - } + testImplementation('org.apache.commons:commons-lang3:3.12.0') + testImplementation(deps.'hive'.'hive-exec-core') + testImplementation project(':coral-common') testCompile deps.'hadoop'.'hadoop-mapreduce-client-core' testCompile deps.'kryo' diff --git a/coral-incremental/src/main/java/com/linkedin/coral/incremental/RelNodeIncrementalTransformer.java b/coral-incremental/src/main/java/com/linkedin/coral/incremental/RelNodeIncrementalTransformer.java index 5b59c11d1..ef234cfe2 100644 --- a/coral-incremental/src/main/java/com/linkedin/coral/incremental/RelNodeIncrementalTransformer.java +++ b/coral-incremental/src/main/java/com/linkedin/coral/incremental/RelNodeIncrementalTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -11,20 +11,20 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; -import org.apache.calcite.plan.RelOptTable; -import org.apache.calcite.prepare.RelOptTableImpl; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.rel.RelShuttle; -import org.apache.calcite.rel.RelShuttleImpl; -import org.apache.calcite.rel.core.TableScan; -import org.apache.calcite.rel.logical.LogicalAggregate; -import org.apache.calcite.rel.logical.LogicalFilter; -import org.apache.calcite.rel.logical.LogicalJoin; -import org.apache.calcite.rel.logical.LogicalProject; -import org.apache.calcite.rel.logical.LogicalTableScan; -import org.apache.calcite.rel.logical.LogicalUnion; -import org.apache.calcite.rex.RexBuilder; -import org.apache.calcite.rex.RexNode; +import com.linkedin.relocated.org.apache.calcite.plan.RelOptTable; +import com.linkedin.relocated.org.apache.calcite.prepare.RelOptTableImpl; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.rel.RelShuttle; +import com.linkedin.relocated.org.apache.calcite.rel.RelShuttleImpl; +import com.linkedin.relocated.org.apache.calcite.rel.core.TableScan; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalAggregate; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalFilter; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalJoin; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalProject; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalTableScan; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalUnion; +import com.linkedin.relocated.org.apache.calcite.rex.RexBuilder; +import com.linkedin.relocated.org.apache.calcite.rex.RexNode; public class RelNodeIncrementalTransformer { diff --git a/coral-incremental/src/test/java/com/linkedin/coral/incremental/RelToIncrementalSqlConverterTest.java b/coral-incremental/src/test/java/com/linkedin/coral/incremental/RelToIncrementalSqlConverterTest.java index 3ac0cd683..a9d84dfaf 100644 --- a/coral-incremental/src/test/java/com/linkedin/coral/incremental/RelToIncrementalSqlConverterTest.java +++ b/coral-incremental/src/test/java/com/linkedin/coral/incremental/RelToIncrementalSqlConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,8 +8,9 @@ import java.io.File; import java.io.IOException; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; + import org.apache.commons.io.FileUtils; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.api.MetaException; @@ -21,7 +22,7 @@ import com.linkedin.coral.transformers.CoralRelToSqlNodeConverter; import static com.linkedin.coral.incremental.TestUtils.*; -import static org.apache.calcite.sql.type.OperandTypes.*; +import static com.linkedin.relocated.org.apache.calcite.sql.type.OperandTypes.*; import static org.testng.Assert.*; diff --git a/coral-pig/build.gradle b/coral-pig/build.gradle index caa48ce6c..cfe2a7f8c 100644 --- a/coral-pig/build.gradle +++ b/coral-pig/build.gradle @@ -1,4 +1,8 @@ dependencies { + api(deps.'linkedin-calcite-core') + implementation project(':coral-common') + implementation("com.google.guava:guava:16.0.1") + implementation("org.apache.commons:commons-lang3:3.12.0") // NOTE: jline is needed as testCompile for PigUnit tests because it is missing from Pig runtime testCompile deps.'jline' @@ -14,10 +18,6 @@ dependencies { // conflicts with DaliStorage/PiggyBank. testCompile(deps.'hive'.'hive-exec-core') { exclude group: 'org.apache.avro', module: 'avro-tools' - // These exclusions are required to prevent duplicate classes since we include - // shaded coral-calcite jar above - exclude group: 'org.apache.calcite', module: 'calcite-core' - exclude group: 'org.apache.calcite', module: 'calcite-avatica' exclude group: 'jline', module: 'jline' exclude group: 'org.codehaus.groovy', module: 'groovy-all' } diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/RelToPigLatinConverter.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/RelToPigLatinConverter.java index 2d8062107..a187afdf1 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/RelToPigLatinConverter.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/RelToPigLatinConverter.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,21 +8,21 @@ import java.util.List; import java.util.stream.Collectors; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.rel.core.TableFunctionScan; -import org.apache.calcite.rel.core.TableScan; -import org.apache.calcite.rel.logical.LogicalAggregate; -import org.apache.calcite.rel.logical.LogicalCorrelate; -import org.apache.calcite.rel.logical.LogicalExchange; -import org.apache.calcite.rel.logical.LogicalFilter; -import org.apache.calcite.rel.logical.LogicalIntersect; -import org.apache.calcite.rel.logical.LogicalJoin; -import org.apache.calcite.rel.logical.LogicalMatch; -import org.apache.calcite.rel.logical.LogicalMinus; -import org.apache.calcite.rel.logical.LogicalProject; -import org.apache.calcite.rel.logical.LogicalSort; -import org.apache.calcite.rel.logical.LogicalUnion; -import org.apache.calcite.rel.logical.LogicalValues; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.rel.core.TableFunctionScan; +import com.linkedin.relocated.org.apache.calcite.rel.core.TableScan; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalAggregate; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalCorrelate; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalExchange; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalFilter; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalIntersect; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalJoin; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalMatch; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalMinus; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalProject; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalSort; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalUnion; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalValues; import com.linkedin.coral.pig.rel2pig.exceptions.UnsupportedRelNodeException; import com.linkedin.coral.pig.rel2pig.rel.PigLogicalAggregate; diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/exceptions/UnsupportedPigTypeException.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/exceptions/UnsupportedPigTypeException.java index fd7683f5d..4d1b8ffe4 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/exceptions/UnsupportedPigTypeException.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/exceptions/UnsupportedPigTypeException.java @@ -1,11 +1,11 @@ /** - * Copyright 2019-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.pig.rel2pig.exceptions; -import org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; /** diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/exceptions/UnsupportedRelNodeException.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/exceptions/UnsupportedRelNodeException.java index c3ffa71dd..5a405bb68 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/exceptions/UnsupportedRelNodeException.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/exceptions/UnsupportedRelNodeException.java @@ -1,11 +1,11 @@ /** - * Copyright 2019-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.pig.rel2pig.exceptions; -import org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; /** diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/exceptions/UnsupportedRexCallException.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/exceptions/UnsupportedRexCallException.java index 2960b8746..df64f2cfe 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/exceptions/UnsupportedRexCallException.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/exceptions/UnsupportedRexCallException.java @@ -1,11 +1,11 @@ /** - * Copyright 2019-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.pig.rel2pig.exceptions; -import org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; /** diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/exceptions/UnsupportedRexNodeException.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/exceptions/UnsupportedRexNodeException.java index 2a9b7b591..38cee110d 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/exceptions/UnsupportedRexNodeException.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/exceptions/UnsupportedRexNodeException.java @@ -1,11 +1,11 @@ /** - * Copyright 2019-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.pig.rel2pig.exceptions; -import org.apache.calcite.rex.RexNode; +import com.linkedin.relocated.org.apache.calcite.rex.RexNode; /** diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/CalcitePigOperatorMap.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/CalcitePigOperatorMap.java index 18a98dce2..e91c9cc0d 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/CalcitePigOperatorMap.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/CalcitePigOperatorMap.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,8 +7,9 @@ import java.util.Map; -import com.linkedin.coral.com.google.common.collect.ImmutableMap; -import com.linkedin.coral.com.google.common.collect.ImmutableSet; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; + import com.linkedin.coral.hive.hive2rel.functions.StaticHiveFunctionRegistry; import com.linkedin.coral.pig.rel2pig.rel.functions.Function; import com.linkedin.coral.pig.rel2pig.rel.functions.PigBuiltinFunction; diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigLogicalAggregate.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigLogicalAggregate.java index 445908a80..34eab6849 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigLogicalAggregate.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigLogicalAggregate.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -9,8 +9,8 @@ import java.util.List; import java.util.stream.Collectors; -import org.apache.calcite.rel.core.AggregateCall; -import org.apache.calcite.rel.logical.LogicalAggregate; +import com.linkedin.relocated.org.apache.calcite.rel.core.AggregateCall; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalAggregate; import com.linkedin.coral.pig.rel2pig.exceptions.UnsupportedRexCallException; diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigLogicalFilter.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigLogicalFilter.java index c9f7a7c38..72c1b33fe 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigLogicalFilter.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigLogicalFilter.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,7 +7,7 @@ import java.util.List; -import org.apache.calcite.rel.logical.LogicalFilter; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalFilter; /** diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigLogicalJoin.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigLogicalJoin.java index 247e098f6..8945b9610 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigLogicalJoin.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigLogicalJoin.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -10,9 +10,10 @@ import java.util.stream.Collectors; import java.util.stream.Stream; -import org.apache.calcite.rel.logical.LogicalJoin; -import org.apache.calcite.rex.RexCall; -import org.apache.calcite.rex.RexNode; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalJoin; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexNode; + import org.apache.commons.lang3.tuple.Pair; import com.linkedin.coral.pig.rel2pig.exceptions.UnsupportedRexCallException; diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigLogicalProject.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigLogicalProject.java index 7c6cab379..8820d31f8 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigLogicalProject.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigLogicalProject.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,8 +8,8 @@ import java.util.ArrayList; import java.util.List; -import org.apache.calcite.rel.logical.LogicalProject; -import org.apache.calcite.rex.RexNode; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalProject; +import com.linkedin.relocated.org.apache.calcite.rex.RexNode; /** diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigLogicalUnion.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigLogicalUnion.java index 620db0e06..92ef58b22 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigLogicalUnion.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigLogicalUnion.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,7 +7,7 @@ import java.util.List; -import org.apache.calcite.rel.logical.LogicalUnion; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalUnion; /** diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigRelUtils.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigRelUtils.java index e8b04d0be..8c234e108 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigRelUtils.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigRelUtils.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -12,12 +12,12 @@ import java.util.Set; import java.util.stream.Collectors; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.rel.logical.LogicalFilter; -import org.apache.calcite.rel.logical.LogicalJoin; -import org.apache.calcite.rel.logical.LogicalProject; -import org.apache.calcite.rex.RexCall; -import org.apache.calcite.rex.RexNode; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalFilter; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalJoin; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalProject; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexNode; import com.linkedin.coral.pig.rel2pig.rel.functions.Function; import com.linkedin.coral.pig.rel2pig.rel.functions.PigUDF; diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigRexUtils.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigRexUtils.java index 67e53720c..1d07a2c9f 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigRexUtils.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigRexUtils.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,18 +7,18 @@ import java.util.List; -import org.apache.calcite.rex.RexCall; -import org.apache.calcite.rex.RexFieldAccess; -import org.apache.calcite.rex.RexInputRef; -import org.apache.calcite.rex.RexLiteral; -import org.apache.calcite.rex.RexNode; -import org.apache.calcite.sql.SqlBinaryOperator; -import org.apache.calcite.sql.SqlPostfixOperator; -import org.apache.calcite.sql.SqlPrefixOperator; -import org.apache.calcite.sql.SqlSpecialOperator; -import org.apache.calcite.sql.fun.SqlCaseOperator; -import org.apache.calcite.sql.fun.SqlCastFunction; -import org.apache.calcite.util.NlsString; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexFieldAccess; +import com.linkedin.relocated.org.apache.calcite.rex.RexInputRef; +import com.linkedin.relocated.org.apache.calcite.rex.RexLiteral; +import com.linkedin.relocated.org.apache.calcite.rex.RexNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlBinaryOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlPostfixOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlPrefixOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlSpecialOperator; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlCaseOperator; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlCastFunction; +import com.linkedin.relocated.org.apache.calcite.util.NlsString; import com.linkedin.coral.pig.rel2pig.exceptions.UnsupportedRexNodeException; import com.linkedin.coral.pig.rel2pig.rel.operators.PigBinaryOperator; diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigTableScan.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigTableScan.java index ea9ff706e..29c38bdca 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigTableScan.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/PigTableScan.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,7 +7,7 @@ import java.util.List; -import org.apache.calcite.rel.core.TableScan; +import com.linkedin.relocated.org.apache.calcite.rel.core.TableScan; import com.linkedin.coral.pig.rel2pig.PigLoadFunction; import com.linkedin.coral.pig.rel2pig.TableToPigPathFunction; diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/Function.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/Function.java index 2c3eb4898..055e2bef6 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/Function.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/Function.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,7 +7,7 @@ import java.util.List; -import org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; /** diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigBuiltinFunction.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigBuiltinFunction.java index decf84bb6..2f97fd2a1 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigBuiltinFunction.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigBuiltinFunction.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,7 +8,7 @@ import java.util.List; import java.util.stream.Collectors; -import org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; import com.linkedin.coral.pig.rel2pig.rel.PigRexUtils; diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigIfFunction.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigIfFunction.java index 66f3ab97c..fc6c2971e 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigIfFunction.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigIfFunction.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,7 +7,7 @@ import java.util.List; -import org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; import com.linkedin.coral.pig.rel2pig.rel.operators.PigCaseOperator; diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigLog2Function.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigLog2Function.java index 42bdc1d28..b5ad5063d 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigLog2Function.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigLog2Function.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,7 +7,7 @@ import java.util.List; -import org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; import com.linkedin.coral.pig.rel2pig.rel.PigRexUtils; diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigLogFunction.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigLogFunction.java index 1e4ff6ea4..03f0e2b0a 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigLogFunction.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigLogFunction.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,7 +7,7 @@ import java.util.List; -import org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; import com.linkedin.coral.pig.rel2pig.rel.PigRexUtils; diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigRandomFunction.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigRandomFunction.java index 79b949d67..51e7969fc 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigRandomFunction.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigRandomFunction.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,7 +8,7 @@ import java.util.Collections; import java.util.List; -import org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; /** diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigRoundFunction.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigRoundFunction.java index 1112b478e..2bba40b46 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigRoundFunction.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigRoundFunction.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,7 +7,7 @@ import java.util.List; -import org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; /** diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigSubstringFunction.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigSubstringFunction.java index e172e1a54..904f481ed 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigSubstringFunction.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigSubstringFunction.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,7 +8,7 @@ import java.util.Arrays; import java.util.List; -import org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; import com.linkedin.coral.pig.rel2pig.rel.PigRexUtils; diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigUDF.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigUDF.java index ea419fd91..2598f9856 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigUDF.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/functions/PigUDF.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -11,10 +11,10 @@ import java.util.Set; import java.util.stream.Collectors; -import org.apache.calcite.rex.RexCall; -import org.apache.calcite.rex.RexNode; +import com.google.common.collect.ImmutableList; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexNode; -import com.linkedin.coral.com.google.common.collect.ImmutableList; import com.linkedin.coral.hive.hive2rel.functions.VersionedSqlUserDefinedFunction; import com.linkedin.coral.pig.rel2pig.rel.PigRexUtils; diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigBinaryOperator.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigBinaryOperator.java index 51214c463..f1c83ad4c 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigBinaryOperator.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigBinaryOperator.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,7 +7,7 @@ import java.util.List; -import org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; import com.linkedin.coral.common.functions.UnknownSqlFunctionException; import com.linkedin.coral.pig.rel2pig.rel.PigRexUtils; diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigCaseOperator.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigCaseOperator.java index 8c8ae1ea3..d2c7ddbeb 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigCaseOperator.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigCaseOperator.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,7 +8,7 @@ import java.util.ArrayList; import java.util.List; -import org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; import com.linkedin.coral.pig.rel2pig.rel.PigRexUtils; diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigCastFunction.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigCastFunction.java index b749552b6..2ee9cdca6 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigCastFunction.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigCastFunction.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,12 +8,12 @@ import java.util.List; import java.util.Map; -import org.apache.calcite.rex.RexCall; -import org.apache.calcite.rex.RexNode; -import org.apache.calcite.sql.type.SqlTypeName; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMultimap; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexNode; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; -import com.linkedin.coral.com.google.common.collect.ImmutableMap; -import com.linkedin.coral.com.google.common.collect.ImmutableMultimap; import com.linkedin.coral.pig.rel2pig.exceptions.IllegalPigCastException; import com.linkedin.coral.pig.rel2pig.exceptions.UnsupportedPigTypeException; import com.linkedin.coral.pig.rel2pig.rel.PigRexUtils; diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigFunction.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigFunction.java index e3ff9d056..93d5c0ff6 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigFunction.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigFunction.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,7 +7,7 @@ import java.util.List; -import org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; import com.linkedin.coral.pig.rel2pig.exceptions.UnsupportedRexCallException; import com.linkedin.coral.pig.rel2pig.rel.CalcitePigOperatorMap; diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigOperator.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigOperator.java index 63525bdd4..bfd3914b4 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigOperator.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigOperator.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,7 +7,7 @@ import java.util.List; -import org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; /** diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigPostfixOperator.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigPostfixOperator.java index 842100214..eba81543b 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigPostfixOperator.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigPostfixOperator.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2021 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,7 +7,7 @@ import java.util.List; -import org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; import com.linkedin.coral.pig.rel2pig.exceptions.UnsupportedRexCallException; import com.linkedin.coral.pig.rel2pig.rel.PigRexUtils; diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigPrefixOperator.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigPrefixOperator.java index 74b6a31ea..081b7a3de 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigPrefixOperator.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigPrefixOperator.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,7 +7,7 @@ import java.util.List; -import org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; import com.linkedin.coral.common.functions.UnknownSqlFunctionException; import com.linkedin.coral.pig.rel2pig.rel.PigRexUtils; diff --git a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigSpecialOperator.java b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigSpecialOperator.java index 0a8edb9c5..1c3a4fa2f 100644 --- a/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigSpecialOperator.java +++ b/coral-pig/src/main/java/com/linkedin/coral/pig/rel2pig/rel/operators/PigSpecialOperator.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,9 +8,9 @@ import java.util.List; import java.util.stream.Collectors; -import org.apache.calcite.rex.RexCall; -import org.apache.calcite.rex.RexNode; -import org.apache.calcite.sql.type.MapSqlType; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexNode; +import com.linkedin.relocated.org.apache.calcite.sql.type.MapSqlType; import com.linkedin.coral.common.functions.UnknownSqlFunctionException; import com.linkedin.coral.pig.rel2pig.exceptions.UnsupportedRexCallException; diff --git a/coral-pig/src/test/java/com/linkedin/coral/pig/rel2pig/TestUtils.java b/coral-pig/src/test/java/com/linkedin/coral/pig/rel2pig/TestUtils.java index 1ffdef5db..c658a8d02 100644 --- a/coral-pig/src/test/java/com/linkedin/coral/pig/rel2pig/TestUtils.java +++ b/coral-pig/src/test/java/com/linkedin/coral/pig/rel2pig/TestUtils.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -10,8 +10,9 @@ import java.io.InputStream; import java.util.UUID; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.runtime.Hook; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.runtime.Hook; + import org.apache.commons.io.FileUtils; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.api.MetaException; diff --git a/coral-schema/build.gradle b/coral-schema/build.gradle index a68a62799..d51bd5704 100644 --- a/coral-schema/build.gradle +++ b/coral-schema/build.gradle @@ -1,13 +1,21 @@ dependencies { + implementation("com.google.code.findbugs:jsr305:3.0.2") + implementation("com.google.guava:guava:16.0.1") + // https://mvnrepository.com/artifact/org.apache.avro/avro + implementation("org.apache.avro:avro:1.12.0") + api(deps.'linkedin-calcite-core') + implementation(deps.hive.'hive-serde') { + transitive = false + } + implementation(deps.hive.'hive-metastore') + implementation("org.apache.commons:commons-lang3:3.12.0") + implementation project(':coral-common') compile project(path: ':coral-hive') compile deps.'avroCompatHelper' - testCompile(deps.'hive'.'hive-exec-core') { exclude group: 'org.apache.avro', module: 'avro-tools' // These exclusions are required to prevent duplicate classes since we include // shaded jar above - exclude group: 'org.apache.calcite', module: 'calcite-core' - exclude group: 'org.apache.calcite', module: 'calcite-avatica' } testCompile deps.'hadoop'.'hadoop-mapreduce-client-core' diff --git a/coral-schema/src/main/java/com/linkedin/coral/schema/avro/AvroSchemaVisitor.java b/coral-schema/src/main/java/com/linkedin/coral/schema/avro/AvroSchemaVisitor.java index 7fa1fe613..f96b7684e 100644 --- a/coral-schema/src/main/java/com/linkedin/coral/schema/avro/AvroSchemaVisitor.java +++ b/coral-schema/src/main/java/com/linkedin/coral/schema/avro/AvroSchemaVisitor.java @@ -1,5 +1,5 @@ /** - * Copyright 2021-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2021-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,10 +8,10 @@ import java.util.Deque; import java.util.List; -import org.apache.avro.Schema; +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; -import com.linkedin.coral.com.google.common.base.Preconditions; -import com.linkedin.coral.com.google.common.collect.Lists; +import org.apache.avro.Schema; public abstract class AvroSchemaVisitor { diff --git a/coral-schema/src/main/java/com/linkedin/coral/schema/avro/HiveSchemaWithPartnerVisitor.java b/coral-schema/src/main/java/com/linkedin/coral/schema/avro/HiveSchemaWithPartnerVisitor.java index 9175a9871..049b00f8e 100644 --- a/coral-schema/src/main/java/com/linkedin/coral/schema/avro/HiveSchemaWithPartnerVisitor.java +++ b/coral-schema/src/main/java/com/linkedin/coral/schema/avro/HiveSchemaWithPartnerVisitor.java @@ -1,5 +1,5 @@ /** - * Copyright 2021-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2021-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,6 +7,8 @@ import java.util.List; +import com.google.common.collect.Lists; + import org.apache.hadoop.hive.serde2.typeinfo.ListTypeInfo; import org.apache.hadoop.hive.serde2.typeinfo.MapTypeInfo; import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo; @@ -14,8 +16,6 @@ import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo; import org.apache.hadoop.hive.serde2.typeinfo.UnionTypeInfo; -import com.linkedin.coral.com.google.common.collect.Lists; - /** * A Hive {@link TypeInfo} visitor with an accompanying partner schema diff --git a/coral-schema/src/main/java/com/linkedin/coral/schema/avro/MergeHiveSchemaWithAvro.java b/coral-schema/src/main/java/com/linkedin/coral/schema/avro/MergeHiveSchemaWithAvro.java index 267a30242..680bf8dde 100644 --- a/coral-schema/src/main/java/com/linkedin/coral/schema/avro/MergeHiveSchemaWithAvro.java +++ b/coral-schema/src/main/java/com/linkedin/coral/schema/avro/MergeHiveSchemaWithAvro.java @@ -1,5 +1,5 @@ /** - * Copyright 2021-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2021-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -9,6 +9,7 @@ import java.util.List; import java.util.concurrent.atomic.AtomicInteger; +import com.google.common.base.Preconditions; import com.linkedin.avroutil1.compatibility.AvroCompatibilityHelper; import com.linkedin.avroutil1.compatibility.Jackson1Utils; @@ -23,8 +24,6 @@ import org.apache.hadoop.hive.serde2.typeinfo.UnionTypeInfo; import org.codehaus.jackson.node.JsonNodeFactory; -import com.linkedin.coral.com.google.common.base.Preconditions; - import static com.linkedin.coral.schema.avro.AvroSerdeUtils.*; diff --git a/coral-schema/src/main/java/com/linkedin/coral/schema/avro/RelDataTypeToAvroType.java b/coral-schema/src/main/java/com/linkedin/coral/schema/avro/RelDataTypeToAvroType.java index 450754b54..5a0172bbb 100644 --- a/coral-schema/src/main/java/com/linkedin/coral/schema/avro/RelDataTypeToAvroType.java +++ b/coral-schema/src/main/java/com/linkedin/coral/schema/avro/RelDataTypeToAvroType.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -11,23 +11,22 @@ import javax.annotation.Nonnull; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import com.google.common.base.Preconditions; import com.linkedin.avroutil1.compatibility.AvroCompatibilityHelper; -import com.linkedin.avroutil1.compatibility.Jackson1Utils; +import com.linkedin.avroutil1.compatibility.Jackson2Utils; +import com.linkedin.relocated.org.apache.calcite.rel.type.DynamicRecordType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeField; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelRecordType; +import com.linkedin.relocated.org.apache.calcite.sql.type.ArraySqlType; +import com.linkedin.relocated.org.apache.calcite.sql.type.BasicSqlType; +import com.linkedin.relocated.org.apache.calcite.sql.type.MapSqlType; +import com.linkedin.relocated.org.apache.calcite.sql.type.MultisetSqlType; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; import org.apache.avro.Schema; -import org.apache.calcite.rel.type.DynamicRecordType; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeField; -import org.apache.calcite.rel.type.RelRecordType; -import org.apache.calcite.sql.type.ArraySqlType; -import org.apache.calcite.sql.type.BasicSqlType; -import org.apache.calcite.sql.type.MapSqlType; -import org.apache.calcite.sql.type.MultisetSqlType; -import org.apache.calcite.sql.type.SqlTypeName; import org.apache.hadoop.hive.serde2.avro.AvroSerDe; -import org.codehaus.jackson.node.JsonNodeFactory; - -import com.linkedin.coral.com.google.common.base.Preconditions; /** @@ -124,9 +123,9 @@ private static Schema basicSqlTypeToAvroType(BasicSqlType relDataType) { Schema decimalSchema = Schema.create(Schema.Type.BYTES); decimalSchema.addProp(AvroSerDe.AVRO_PROP_LOGICAL_TYPE, AvroSerDe.DECIMAL_TYPE_NAME); AvroCompatibilityHelper.setSchemaPropFromJsonString(decimalSchema, AvroSerDe.AVRO_PROP_PRECISION, - Jackson1Utils.toJsonString(factory.numberNode(relDataType.getPrecision())), false); + Jackson2Utils.toJsonString(factory.numberNode(relDataType.getPrecision())), false); AvroCompatibilityHelper.setSchemaPropFromJsonString(decimalSchema, AvroSerDe.AVRO_PROP_SCALE, - Jackson1Utils.toJsonString(factory.numberNode(relDataType.getScale())), false); + Jackson2Utils.toJsonString(factory.numberNode(relDataType.getScale())), false); return decimalSchema; default: throw new UnsupportedOperationException(relDataType.getSqlTypeName() + " is not supported."); diff --git a/coral-schema/src/main/java/com/linkedin/coral/schema/avro/RelToAvroSchemaConverter.java b/coral-schema/src/main/java/com/linkedin/coral/schema/avro/RelToAvroSchemaConverter.java index a7165a779..08d0e023d 100644 --- a/coral-schema/src/main/java/com/linkedin/coral/schema/avro/RelToAvroSchemaConverter.java +++ b/coral-schema/src/main/java/com/linkedin/coral/schema/avro/RelToAvroSchemaConverter.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -14,49 +14,50 @@ import javax.annotation.Nonnull; +import com.google.common.base.Preconditions; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.rel.RelShuttleImpl; +import com.linkedin.relocated.org.apache.calcite.rel.core.AggregateCall; +import com.linkedin.relocated.org.apache.calcite.rel.core.TableFunctionScan; +import com.linkedin.relocated.org.apache.calcite.rel.core.TableScan; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalAggregate; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalCorrelate; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalExchange; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalFilter; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalIntersect; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalJoin; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalMatch; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalMinus; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalProject; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalSort; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalTableFunctionScan; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalUnion; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalValues; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeField; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexCorrelVariable; +import com.linkedin.relocated.org.apache.calcite.rex.RexDynamicParam; +import com.linkedin.relocated.org.apache.calcite.rex.RexFieldAccess; +import com.linkedin.relocated.org.apache.calcite.rex.RexInputRef; +import com.linkedin.relocated.org.apache.calcite.rex.RexLiteral; +import com.linkedin.relocated.org.apache.calcite.rex.RexLocalRef; +import com.linkedin.relocated.org.apache.calcite.rex.RexNode; +import com.linkedin.relocated.org.apache.calcite.rex.RexOver; +import com.linkedin.relocated.org.apache.calcite.rex.RexPatternFieldRef; +import com.linkedin.relocated.org.apache.calcite.rex.RexRangeRef; +import com.linkedin.relocated.org.apache.calcite.rex.RexShuttle; +import com.linkedin.relocated.org.apache.calcite.rex.RexSubQuery; +import com.linkedin.relocated.org.apache.calcite.rex.RexTableInputRef; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlUserDefinedFunction; +import com.linkedin.relocated.org.apache.calcite.util.Pair; + import org.apache.avro.Schema; import org.apache.avro.SchemaBuilder; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.rel.RelShuttleImpl; -import org.apache.calcite.rel.core.AggregateCall; -import org.apache.calcite.rel.core.TableFunctionScan; -import org.apache.calcite.rel.core.TableScan; -import org.apache.calcite.rel.logical.LogicalAggregate; -import org.apache.calcite.rel.logical.LogicalCorrelate; -import org.apache.calcite.rel.logical.LogicalExchange; -import org.apache.calcite.rel.logical.LogicalFilter; -import org.apache.calcite.rel.logical.LogicalIntersect; -import org.apache.calcite.rel.logical.LogicalJoin; -import org.apache.calcite.rel.logical.LogicalMatch; -import org.apache.calcite.rel.logical.LogicalMinus; -import org.apache.calcite.rel.logical.LogicalProject; -import org.apache.calcite.rel.logical.LogicalSort; -import org.apache.calcite.rel.logical.LogicalTableFunctionScan; -import org.apache.calcite.rel.logical.LogicalUnion; -import org.apache.calcite.rel.logical.LogicalValues; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeField; -import org.apache.calcite.rex.RexCall; -import org.apache.calcite.rex.RexCorrelVariable; -import org.apache.calcite.rex.RexDynamicParam; -import org.apache.calcite.rex.RexFieldAccess; -import org.apache.calcite.rex.RexInputRef; -import org.apache.calcite.rex.RexLiteral; -import org.apache.calcite.rex.RexLocalRef; -import org.apache.calcite.rex.RexNode; -import org.apache.calcite.rex.RexOver; -import org.apache.calcite.rex.RexPatternFieldRef; -import org.apache.calcite.rex.RexRangeRef; -import org.apache.calcite.rex.RexShuttle; -import org.apache.calcite.rex.RexSubQuery; -import org.apache.calcite.rex.RexTableInputRef; -import org.apache.calcite.sql.validate.SqlUserDefinedFunction; -import org.apache.calcite.util.Pair; import org.apache.hadoop.hive.metastore.api.Table; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.linkedin.coral.com.google.common.base.Preconditions; import com.linkedin.coral.common.HiveMetastoreClient; import com.linkedin.coral.common.HiveUncollect; import com.linkedin.coral.hive.hive2rel.functions.OrdinalReturnTypeInferenceV2; diff --git a/coral-schema/src/main/java/com/linkedin/coral/schema/avro/SchemaUtilities.java b/coral-schema/src/main/java/com/linkedin/coral/schema/avro/SchemaUtilities.java index cde0a992d..fe017ec70 100644 --- a/coral-schema/src/main/java/com/linkedin/coral/schema/avro/SchemaUtilities.java +++ b/coral-schema/src/main/java/com/linkedin/coral/schema/avro/SchemaUtilities.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -15,21 +15,23 @@ import javax.annotation.Nullable; import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Preconditions; +import com.google.common.base.Strings; import com.google.common.collect.ImmutableSet; import com.linkedin.avroutil1.compatibility.AvroCompatibilityHelper; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.rel.core.AggregateCall; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalAggregate; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexInputRef; +import com.linkedin.relocated.org.apache.calcite.rex.RexLiteral; +import com.linkedin.relocated.org.apache.calcite.rex.RexNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlKind; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlUserDefinedFunction; import org.apache.avro.Schema; import org.apache.avro.SchemaBuilder; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.rel.core.AggregateCall; -import org.apache.calcite.rel.logical.LogicalAggregate; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rex.RexCall; -import org.apache.calcite.rex.RexInputRef; -import org.apache.calcite.rex.RexLiteral; -import org.apache.calcite.rex.RexNode; -import org.apache.calcite.sql.SqlKind; -import org.apache.calcite.sql.validate.SqlUserDefinedFunction; import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.hive.metastore.api.FieldSchema; import org.apache.hadoop.hive.metastore.api.Table; @@ -40,8 +42,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.linkedin.coral.com.google.common.base.Preconditions; -import com.linkedin.coral.com.google.common.base.Strings; import com.linkedin.coral.schema.avro.exceptions.SchemaNotFoundException; import static com.linkedin.coral.schema.avro.AvroSerdeUtils.*; diff --git a/coral-schema/src/main/java/com/linkedin/coral/schema/avro/TypeInfoToAvroSchemaConverter.java b/coral-schema/src/main/java/com/linkedin/coral/schema/avro/TypeInfoToAvroSchemaConverter.java index aa53de9a5..c5332d3e3 100644 --- a/coral-schema/src/main/java/com/linkedin/coral/schema/avro/TypeInfoToAvroSchemaConverter.java +++ b/coral-schema/src/main/java/com/linkedin/coral/schema/avro/TypeInfoToAvroSchemaConverter.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -9,6 +9,7 @@ import java.util.Arrays; import java.util.List; +import com.google.common.collect.Lists; import com.linkedin.avroutil1.compatibility.AvroCompatibilityHelper; import com.linkedin.avroutil1.compatibility.Jackson1Utils; @@ -26,8 +27,6 @@ import org.apache.hadoop.hive.serde2.typeinfo.UnionTypeInfo; import org.codehaus.jackson.node.JsonNodeFactory; -import com.linkedin.coral.com.google.common.collect.Lists; - /** * This class converts Hive TypeInfo schema to avro schema diff --git a/coral-schema/src/main/java/com/linkedin/coral/schema/avro/ViewToAvroSchemaConverter.java b/coral-schema/src/main/java/com/linkedin/coral/schema/avro/ViewToAvroSchemaConverter.java index 3d9ebcb25..db1ed73e1 100644 --- a/coral-schema/src/main/java/com/linkedin/coral/schema/avro/ViewToAvroSchemaConverter.java +++ b/coral-schema/src/main/java/com/linkedin/coral/schema/avro/ViewToAvroSchemaConverter.java @@ -1,18 +1,19 @@ /** - * Copyright 2019-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.schema.avro; +import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Preconditions; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; + import org.apache.avro.Schema; -import org.apache.calcite.rel.RelNode; import org.apache.hadoop.hive.metastore.api.Table; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.linkedin.coral.com.google.common.annotations.VisibleForTesting; -import com.linkedin.coral.com.google.common.base.Preconditions; import com.linkedin.coral.common.HiveMetastoreClient; import com.linkedin.coral.hive.hive2rel.HiveToRelConverter; diff --git a/coral-schema/src/test/java/com/linkedin/coral/schema/avro/MergeHiveSchemaWithAvroTests.java b/coral-schema/src/test/java/com/linkedin/coral/schema/avro/MergeHiveSchemaWithAvroTests.java index 5b6a1ab31..a7ec2ae9e 100644 --- a/coral-schema/src/test/java/com/linkedin/coral/schema/avro/MergeHiveSchemaWithAvroTests.java +++ b/coral-schema/src/test/java/com/linkedin/coral/schema/avro/MergeHiveSchemaWithAvroTests.java @@ -1,5 +1,5 @@ /** - * Copyright 2020-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2020-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -9,6 +9,9 @@ import java.util.Map; import java.util.stream.Collectors; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Lists; import com.linkedin.avroutil1.compatibility.AvroCompatibilityHelper; import com.linkedin.avroutil1.compatibility.Jackson1Utils; @@ -21,10 +24,6 @@ import org.codehaus.jackson.node.IntNode; import org.testng.annotations.Test; -import com.linkedin.coral.com.google.common.base.Preconditions; -import com.linkedin.coral.com.google.common.collect.ImmutableMap; -import com.linkedin.coral.com.google.common.collect.Lists; - import static org.testng.Assert.*; diff --git a/coral-schema/src/test/java/com/linkedin/coral/schema/avro/RelDataTypeToAvroTypeTests.java b/coral-schema/src/test/java/com/linkedin/coral/schema/avro/RelDataTypeToAvroTypeTests.java index b2973c916..2233c8513 100644 --- a/coral-schema/src/test/java/com/linkedin/coral/schema/avro/RelDataTypeToAvroTypeTests.java +++ b/coral-schema/src/test/java/com/linkedin/coral/schema/avro/RelDataTypeToAvroTypeTests.java @@ -1,5 +1,5 @@ /** - * Copyright 2020-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2020-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,8 +8,9 @@ import java.io.File; import java.io.IOException; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; + import org.apache.avro.Schema; -import org.apache.calcite.rel.RelNode; import org.apache.commons.io.FileUtils; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.api.MetaException; diff --git a/coral-schema/src/test/java/com/linkedin/coral/schema/avro/TestUtils.java b/coral-schema/src/test/java/com/linkedin/coral/schema/avro/TestUtils.java index 2d503ddcd..37a431f72 100644 --- a/coral-schema/src/test/java/com/linkedin/coral/schema/avro/TestUtils.java +++ b/coral-schema/src/test/java/com/linkedin/coral/schema/avro/TestUtils.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -16,9 +16,11 @@ import java.util.UUID; import java.util.stream.Collectors; -import org.apache.calcite.sql.type.ReturnTypes; -import org.apache.calcite.sql.type.SqlTypeFamily; -import org.apache.calcite.sql.type.SqlTypeName; +import com.google.common.collect.ImmutableList; +import com.linkedin.relocated.org.apache.calcite.sql.type.ReturnTypes; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeFamily; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; + import org.apache.commons.io.FileUtils; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.api.MetaException; @@ -28,14 +30,13 @@ import org.apache.hadoop.hive.ql.metadata.HiveException; import org.apache.hadoop.hive.ql.session.SessionState; -import com.linkedin.coral.com.google.common.collect.ImmutableList; import com.linkedin.coral.common.HiveMetastoreClient; import com.linkedin.coral.common.HiveMscAdapter; import com.linkedin.coral.common.functions.FunctionReturnTypes; import com.linkedin.coral.hive.hive2rel.functions.OrdinalReturnTypeInferenceV2; import com.linkedin.coral.hive.hive2rel.functions.StaticHiveFunctionRegistry; -import static org.apache.calcite.sql.type.OperandTypes.*; +import static com.linkedin.relocated.org.apache.calcite.sql.type.OperandTypes.*; public class TestUtils { diff --git a/coral-service/src/main/java/com/linkedin/coral/coralservice/utils/IncrementalUtils.java b/coral-service/src/main/java/com/linkedin/coral/coralservice/utils/IncrementalUtils.java index 3ee6687f7..572216808 100644 --- a/coral-service/src/main/java/com/linkedin/coral/coralservice/utils/IncrementalUtils.java +++ b/coral-service/src/main/java/com/linkedin/coral/coralservice/utils/IncrementalUtils.java @@ -1,11 +1,11 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.coralservice.utils; -import org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; import com.linkedin.coral.hive.hive2rel.HiveToRelConverter; import com.linkedin.coral.incremental.RelNodeIncrementalTransformer; diff --git a/coral-service/src/main/java/com/linkedin/coral/coralservice/utils/TranslationUtils.java b/coral-service/src/main/java/com/linkedin/coral/coralservice/utils/TranslationUtils.java index d0987cd39..591f8fe30 100644 --- a/coral-service/src/main/java/com/linkedin/coral/coralservice/utils/TranslationUtils.java +++ b/coral-service/src/main/java/com/linkedin/coral/coralservice/utils/TranslationUtils.java @@ -1,11 +1,11 @@ /** - * Copyright 2022-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2022-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.coralservice.utils; -import org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; import com.linkedin.coral.hive.hive2rel.HiveToRelConverter; import com.linkedin.coral.spark.CoralSpark; diff --git a/coral-service/src/main/java/com/linkedin/coral/coralservice/utils/VisualizationUtils.java b/coral-service/src/main/java/com/linkedin/coral/coralservice/utils/VisualizationUtils.java index a3b91bd94..6ccf26b6b 100644 --- a/coral-service/src/main/java/com/linkedin/coral/coralservice/utils/VisualizationUtils.java +++ b/coral-service/src/main/java/com/linkedin/coral/coralservice/utils/VisualizationUtils.java @@ -1,5 +1,5 @@ /** - * Copyright 2022-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2022-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -9,8 +9,8 @@ import java.util.ArrayList; import java.util.UUID; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; import com.linkedin.coral.hive.hive2rel.HiveToRelConverter; import com.linkedin.coral.incremental.RelNodeIncrementalTransformer; diff --git a/coral-spark-plan/build.gradle b/coral-spark-plan/build.gradle index b0cefa81d..187f88e2e 100644 --- a/coral-spark-plan/build.gradle +++ b/coral-spark-plan/build.gradle @@ -1,12 +1,11 @@ dependencies { + api project(':coral-common') + implementation(deps.'linkedin-calcite-core') + implementation('org.apache.commons:commons-lang3:3.12.0') compile project(':coral-hive') testCompile(deps.'hive'.'hive-exec-core') { exclude group: 'org.apache.avro', module: 'avro-tools' - // These exclusions are required to prevent duplicate classes since we - // include shaded jar above - exclude group: 'org.apache.calcite', module: 'calcite-core' - exclude group: 'org.apache.calcite', module: 'calcite-avatica' } testCompile deps.'hadoop'.'hadoop-mapreduce-client-core' diff --git a/coral-spark-plan/src/main/java/com/linkedin/coral/sparkplan/SparkPlanToIRRelConverter.java b/coral-spark-plan/src/main/java/com/linkedin/coral/sparkplan/SparkPlanToIRRelConverter.java index 35a2fbdcf..7f7e73683 100644 --- a/coral-spark-plan/src/main/java/com/linkedin/coral/sparkplan/SparkPlanToIRRelConverter.java +++ b/coral-spark-plan/src/main/java/com/linkedin/coral/sparkplan/SparkPlanToIRRelConverter.java @@ -1,5 +1,5 @@ /** - * Copyright 2020-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2020-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -25,10 +25,10 @@ import java.util.stream.Collectors; import com.google.gson.Gson; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexNode; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.rex.RexCall; -import org.apache.calcite.rex.RexNode; import org.apache.commons.lang3.exception.ExceptionUtils; import com.linkedin.coral.common.HiveMetastoreClient; diff --git a/coral-spark/build.gradle b/coral-spark/build.gradle index f3fbf025c..ec6bc03d2 100644 --- a/coral-spark/build.gradle +++ b/coral-spark/build.gradle @@ -1,18 +1,14 @@ apply from: "spark_itest.gradle" dependencies { + implementation project(':coral-common') compile project(':coral-hive') compile project(':coral-schema') - compileOnly deps.'spark'.'sql' testCompile(deps.'hive'.'hive-exec-core') { exclude group: 'org.apache.avro', module: 'avro-tools' - // These exclusions are required to prevent duplicate classes since we include - // shaded jar above - exclude group: 'org.apache.calcite', module: 'calcite-core' - exclude group: 'org.apache.calcite', module: 'calcite-avatica' } testCompile deps.'hadoop'.'hadoop-mapreduce-client-core' testCompile deps.'kryo' diff --git a/coral-spark/spark_itest.gradle b/coral-spark/spark_itest.gradle index 1b38dd333..bc979c8d9 100644 --- a/coral-spark/spark_itest.gradle +++ b/coral-spark/spark_itest.gradle @@ -11,7 +11,7 @@ for (String itest : itests) { } configurations { - getByName("${itest}testCompile").extendsFrom(testCompile) + getByName("${itest}testImplementation").extendsFrom(testImplementation) getByName("${itest}testRuntime").extendsFrom(testRuntime) } diff --git a/coral-spark/src/main/java/com/linkedin/coral/spark/AddExplicitAlias.java b/coral-spark/src/main/java/com/linkedin/coral/spark/AddExplicitAlias.java index 97807a1ef..f0a50eaba 100644 --- a/coral-spark/src/main/java/com/linkedin/coral/spark/AddExplicitAlias.java +++ b/coral-spark/src/main/java/com/linkedin/coral/spark/AddExplicitAlias.java @@ -1,5 +1,5 @@ /** - * Copyright 2022 LinkedIn Corporation. All rights reserved. + * Copyright 2022-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -10,13 +10,12 @@ import java.util.stream.IntStream; import com.google.common.base.Preconditions; +import com.linkedin.relocated.org.apache.calcite.sql.*; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.util.SqlShuttle; -import org.apache.calcite.sql.*; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.util.SqlShuttle; - -import static org.apache.calcite.rel.rel2sql.SqlImplementor.POS; +import static com.linkedin.relocated.org.apache.calcite.rel.rel2sql.SqlImplementor.POS; public class AddExplicitAlias extends SqlShuttle { diff --git a/coral-spark/src/main/java/com/linkedin/coral/spark/CoralSpark.java b/coral-spark/src/main/java/com/linkedin/coral/spark/CoralSpark.java index 9ef1a23f2..a7d35e88b 100644 --- a/coral-spark/src/main/java/com/linkedin/coral/spark/CoralSpark.java +++ b/coral-spark/src/main/java/com/linkedin/coral/spark/CoralSpark.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -9,16 +9,17 @@ import java.util.Set; import java.util.stream.Collectors; +import com.google.common.collect.ImmutableList; +import com.linkedin.relocated.org.apache.calcite.plan.RelOptTable; +import com.linkedin.relocated.org.apache.calcite.plan.RelOptUtil; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIdentifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlKind; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlSelect; + import org.apache.avro.Schema; -import org.apache.calcite.plan.RelOptTable; -import org.apache.calcite.plan.RelOptUtil; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.SqlKind; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlSelect; - -import com.linkedin.coral.com.google.common.collect.ImmutableList; + import com.linkedin.coral.common.HiveMetastoreClient; import com.linkedin.coral.spark.containers.SparkRelInfo; import com.linkedin.coral.spark.containers.SparkUDFInfo; diff --git a/coral-spark/src/main/java/com/linkedin/coral/spark/CoralSqlNodeToSparkSqlNodeConverter.java b/coral-spark/src/main/java/com/linkedin/coral/spark/CoralSqlNodeToSparkSqlNodeConverter.java index af3e4a0f6..90348a8f1 100644 --- a/coral-spark/src/main/java/com/linkedin/coral/spark/CoralSqlNodeToSparkSqlNodeConverter.java +++ b/coral-spark/src/main/java/com/linkedin/coral/spark/CoralSqlNodeToSparkSqlNodeConverter.java @@ -1,5 +1,5 @@ /** - * Copyright 2022-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2022-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,17 +8,17 @@ import java.util.ArrayList; import java.util.List; -import org.apache.calcite.sql.JoinConditionType; -import org.apache.calcite.sql.JoinType; -import org.apache.calcite.sql.SqlBasicCall; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlJoin; -import org.apache.calcite.sql.SqlKind; -import org.apache.calcite.sql.SqlLiteral; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlOperator; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.util.SqlShuttle; +import com.linkedin.relocated.org.apache.calcite.sql.JoinConditionType; +import com.linkedin.relocated.org.apache.calcite.sql.JoinType; +import com.linkedin.relocated.org.apache.calcite.sql.SqlBasicCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlJoin; +import com.linkedin.relocated.org.apache.calcite.sql.SqlKind; +import com.linkedin.relocated.org.apache.calcite.sql.SqlLiteral; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperator; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.util.SqlShuttle; import com.linkedin.coral.common.functions.CoralSqlUnnestOperator; import com.linkedin.coral.spark.functions.SqlLateralJoin; diff --git a/coral-spark/src/main/java/com/linkedin/coral/spark/CoralToSparkSqlCallConverter.java b/coral-spark/src/main/java/com/linkedin/coral/spark/CoralToSparkSqlCallConverter.java index bebd38e94..4bd8e1229 100644 --- a/coral-spark/src/main/java/com/linkedin/coral/spark/CoralToSparkSqlCallConverter.java +++ b/coral-spark/src/main/java/com/linkedin/coral/spark/CoralToSparkSqlCallConverter.java @@ -1,5 +1,5 @@ /** - * Copyright 2023-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,10 +7,10 @@ import java.util.Set; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.util.SqlShuttle; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.util.SqlShuttle; import com.linkedin.coral.common.transformers.OperatorRenameSqlCallTransformer; import com.linkedin.coral.common.transformers.SqlCallTransformers; diff --git a/coral-spark/src/main/java/com/linkedin/coral/spark/DataTypeDerivedSqlCallConverter.java b/coral-spark/src/main/java/com/linkedin/coral/spark/DataTypeDerivedSqlCallConverter.java index 079031a7f..790864f6c 100644 --- a/coral-spark/src/main/java/com/linkedin/coral/spark/DataTypeDerivedSqlCallConverter.java +++ b/coral-spark/src/main/java/com/linkedin/coral/spark/DataTypeDerivedSqlCallConverter.java @@ -1,5 +1,5 @@ /** - * Copyright 2022-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2022-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,9 +7,9 @@ import java.util.Set; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.util.SqlShuttle; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.util.SqlShuttle; import com.linkedin.coral.common.HiveMetastoreClient; import com.linkedin.coral.common.transformers.SqlCallTransformers; diff --git a/coral-spark/src/main/java/com/linkedin/coral/spark/IRRelToSparkRelTransformer.java b/coral-spark/src/main/java/com/linkedin/coral/spark/IRRelToSparkRelTransformer.java index 97f2934a6..31495cd40 100644 --- a/coral-spark/src/main/java/com/linkedin/coral/spark/IRRelToSparkRelTransformer.java +++ b/coral-spark/src/main/java/com/linkedin/coral/spark/IRRelToSparkRelTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -10,32 +10,32 @@ import java.util.Optional; import java.util.Set; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.rel.RelShuttle; -import org.apache.calcite.rel.RelShuttleImpl; -import org.apache.calcite.rel.core.TableFunctionScan; -import org.apache.calcite.rel.core.TableScan; -import org.apache.calcite.rel.logical.LogicalAggregate; -import org.apache.calcite.rel.logical.LogicalCorrelate; -import org.apache.calcite.rel.logical.LogicalExchange; -import org.apache.calcite.rel.logical.LogicalFilter; -import org.apache.calcite.rel.logical.LogicalIntersect; -import org.apache.calcite.rel.logical.LogicalJoin; -import org.apache.calcite.rel.logical.LogicalMatch; -import org.apache.calcite.rel.logical.LogicalMinus; -import org.apache.calcite.rel.logical.LogicalProject; -import org.apache.calcite.rel.logical.LogicalSort; -import org.apache.calcite.rel.logical.LogicalUnion; -import org.apache.calcite.rel.logical.LogicalValues; -import org.apache.calcite.rex.RexBuilder; -import org.apache.calcite.rex.RexCall; -import org.apache.calcite.rex.RexLiteral; -import org.apache.calcite.rex.RexNode; -import org.apache.calcite.rex.RexShuttle; -import org.apache.calcite.sql.SqlKind; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.type.ArraySqlType; -import org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.rel.RelShuttle; +import com.linkedin.relocated.org.apache.calcite.rel.RelShuttleImpl; +import com.linkedin.relocated.org.apache.calcite.rel.core.TableFunctionScan; +import com.linkedin.relocated.org.apache.calcite.rel.core.TableScan; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalAggregate; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalCorrelate; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalExchange; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalFilter; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalIntersect; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalJoin; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalMatch; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalMinus; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalProject; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalSort; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalUnion; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalValues; +import com.linkedin.relocated.org.apache.calcite.rex.RexBuilder; +import com.linkedin.relocated.org.apache.calcite.rex.RexCall; +import com.linkedin.relocated.org.apache.calcite.rex.RexLiteral; +import com.linkedin.relocated.org.apache.calcite.rex.RexNode; +import com.linkedin.relocated.org.apache.calcite.rex.RexShuttle; +import com.linkedin.relocated.org.apache.calcite.sql.SqlKind; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.type.ArraySqlType; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; import com.linkedin.coral.spark.containers.SparkRelInfo; import com.linkedin.coral.spark.containers.SparkUDFInfo; diff --git a/coral-spark/src/main/java/com/linkedin/coral/spark/SparkSqlRewriter.java b/coral-spark/src/main/java/com/linkedin/coral/spark/SparkSqlRewriter.java index 5cfa3fb6a..822db8c5c 100644 --- a/coral-spark/src/main/java/com/linkedin/coral/spark/SparkSqlRewriter.java +++ b/coral-spark/src/main/java/com/linkedin/coral/spark/SparkSqlRewriter.java @@ -1,24 +1,24 @@ /** - * Copyright 2018-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.spark; -import org.apache.calcite.sql.SqlArrayTypeSpec; -import org.apache.calcite.sql.SqlBasicTypeNameSpec; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlDataTypeSpec; -import org.apache.calcite.sql.SqlIntervalLiteral; -import org.apache.calcite.sql.SqlKind; -import org.apache.calcite.sql.SqlLiteral; -import org.apache.calcite.sql.SqlMapTypeSpec; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlRowTypeSpec; -import org.apache.calcite.sql.SqlTypeNameSpec; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.calcite.sql.util.SqlShuttle; +import com.linkedin.relocated.org.apache.calcite.sql.SqlArrayTypeSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlBasicTypeNameSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlDataTypeSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIntervalLiteral; +import com.linkedin.relocated.org.apache.calcite.sql.SqlKind; +import com.linkedin.relocated.org.apache.calcite.sql.SqlLiteral; +import com.linkedin.relocated.org.apache.calcite.sql.SqlMapTypeSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlRowTypeSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlTypeNameSpec; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.sql.util.SqlShuttle; /** diff --git a/coral-spark/src/main/java/com/linkedin/coral/spark/containers/SparkRelInfo.java b/coral-spark/src/main/java/com/linkedin/coral/spark/containers/SparkRelInfo.java index 7e20bed7a..856abc44c 100644 --- a/coral-spark/src/main/java/com/linkedin/coral/spark/containers/SparkRelInfo.java +++ b/coral-spark/src/main/java/com/linkedin/coral/spark/containers/SparkRelInfo.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,7 +7,7 @@ import java.util.Set; -import org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; /** diff --git a/coral-spark/src/main/java/com/linkedin/coral/spark/dialect/SparkSqlDialect.java b/coral-spark/src/main/java/com/linkedin/coral/spark/dialect/SparkSqlDialect.java index faf330749..969f3b05d 100644 --- a/coral-spark/src/main/java/com/linkedin/coral/spark/dialect/SparkSqlDialect.java +++ b/coral-spark/src/main/java/com/linkedin/coral/spark/dialect/SparkSqlDialect.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -10,16 +10,15 @@ import java.util.Locale; import com.google.common.collect.ImmutableList; - -import org.apache.calcite.avatica.util.Casing; -import org.apache.calcite.config.NullCollation; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlDialect; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlUnnestOperator; -import org.apache.calcite.sql.SqlWriter; -import org.apache.calcite.sql.fun.SqlMultisetValueConstructor; -import org.apache.calcite.sql.fun.SqlSubstringFunction; +import com.linkedin.relocated.org.apache.calcite.avatica.util.Casing; +import com.linkedin.relocated.org.apache.calcite.config.NullCollation; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlDialect; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlUnnestOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlWriter; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlMultisetValueConstructor; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlSubstringFunction; import com.linkedin.coral.common.functions.CoralSqlUnnestOperator; diff --git a/coral-spark/src/main/java/com/linkedin/coral/spark/functions/SqlLateralJoin.java b/coral-spark/src/main/java/com/linkedin/coral/spark/functions/SqlLateralJoin.java index ec6f128cc..f635fc1d7 100644 --- a/coral-spark/src/main/java/com/linkedin/coral/spark/functions/SqlLateralJoin.java +++ b/coral-spark/src/main/java/com/linkedin/coral/spark/functions/SqlLateralJoin.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,17 +7,17 @@ import java.util.List; -import org.apache.calcite.sql.JoinType; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlJoin; -import org.apache.calcite.sql.SqlKind; -import org.apache.calcite.sql.SqlLiteral; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlOperator; -import org.apache.calcite.sql.SqlSyntax; -import org.apache.calcite.sql.SqlWriter; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.util.Util; +import com.linkedin.relocated.org.apache.calcite.sql.JoinType; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlJoin; +import com.linkedin.relocated.org.apache.calcite.sql.SqlKind; +import com.linkedin.relocated.org.apache.calcite.sql.SqlLiteral; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlSyntax; +import com.linkedin.relocated.org.apache.calcite.sql.SqlWriter; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.util.Util; public class SqlLateralJoin extends SqlJoin { diff --git a/coral-spark/src/main/java/com/linkedin/coral/spark/functions/SqlLateralViewAsOperator.java b/coral-spark/src/main/java/com/linkedin/coral/spark/functions/SqlLateralViewAsOperator.java index d0c08ecdb..2960b837c 100644 --- a/coral-spark/src/main/java/com/linkedin/coral/spark/functions/SqlLateralViewAsOperator.java +++ b/coral-spark/src/main/java/com/linkedin/coral/spark/functions/SqlLateralViewAsOperator.java @@ -1,19 +1,19 @@ /** - * Copyright 2018-2022 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.spark.functions; -import org.apache.calcite.sql.SqlAsOperator; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlKind; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlWriter; -import org.apache.calcite.sql.type.InferTypes; -import org.apache.calcite.sql.type.OperandTypes; -import org.apache.calcite.sql.type.ReturnTypes; -import org.apache.calcite.util.Util; +import com.linkedin.relocated.org.apache.calcite.sql.SqlAsOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlKind; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlWriter; +import com.linkedin.relocated.org.apache.calcite.sql.type.InferTypes; +import com.linkedin.relocated.org.apache.calcite.sql.type.OperandTypes; +import com.linkedin.relocated.org.apache.calcite.sql.type.ReturnTypes; +import com.linkedin.relocated.org.apache.calcite.util.Util; /** diff --git a/coral-spark/src/main/java/com/linkedin/coral/spark/transformers/ExtractUnionFunctionTransformer.java b/coral-spark/src/main/java/com/linkedin/coral/spark/transformers/ExtractUnionFunctionTransformer.java index 9572bcbbd..af3d6aa9a 100644 --- a/coral-spark/src/main/java/com/linkedin/coral/spark/transformers/ExtractUnionFunctionTransformer.java +++ b/coral-spark/src/main/java/com/linkedin/coral/spark/transformers/ExtractUnionFunctionTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2023-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -10,18 +10,16 @@ import java.util.List; import java.util.Set; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.rel.type.RelDataTypeField; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlLiteral; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlNumericLiteral; -import org.apache.calcite.sql.SqlOperator; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.hadoop.hive.serde2.typeinfo.UnionTypeInfo; +import com.google.common.collect.ImmutableList; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeField; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlLiteral; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNumericLiteral; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperator; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; -import com.linkedin.coral.com.google.common.collect.ImmutableList; import com.linkedin.coral.common.TypeConverter; import com.linkedin.coral.common.transformers.SqlCallTransformer; import com.linkedin.coral.common.utils.RelDataTypeToHiveTypeStringConverter; @@ -137,7 +135,7 @@ private boolean containsSingleUnionType(RelDataType relDataType) { /** * Check if the given RelDataType is a single union type in Coral IR representation, the conversion to which happens in - * {@link TypeConverter#convert(UnionTypeInfo, RelDataTypeFactory)} + * {@link TypeConverter#convert} */ private boolean isSingleUnionType(RelDataType relDataType) { return relDataType.isStruct() && relDataType.getFieldList().size() == 2 diff --git a/coral-spark/src/main/java/com/linkedin/coral/spark/transformers/FuzzyUnionGenericProjectTransformer.java b/coral-spark/src/main/java/com/linkedin/coral/spark/transformers/FuzzyUnionGenericProjectTransformer.java index 42ec14e8b..7479a5788 100644 --- a/coral-spark/src/main/java/com/linkedin/coral/spark/transformers/FuzzyUnionGenericProjectTransformer.java +++ b/coral-spark/src/main/java/com/linkedin/coral/spark/transformers/FuzzyUnionGenericProjectTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,9 +8,9 @@ import java.net.URI; import java.util.Set; -import org.apache.calcite.sql.SqlCall; +import com.google.common.collect.ImmutableList; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; -import com.linkedin.coral.com.google.common.collect.ImmutableList; import com.linkedin.coral.common.functions.GenericProjectFunction; import com.linkedin.coral.common.transformers.SqlCallTransformer; import com.linkedin.coral.spark.containers.SparkUDFInfo; diff --git a/coral-spark/src/main/java/com/linkedin/coral/spark/transformers/HiveUDFTransformer.java b/coral-spark/src/main/java/com/linkedin/coral/spark/transformers/HiveUDFTransformer.java index ef7d6d510..03de577d8 100644 --- a/coral-spark/src/main/java/com/linkedin/coral/spark/transformers/HiveUDFTransformer.java +++ b/coral-spark/src/main/java/com/linkedin/coral/spark/transformers/HiveUDFTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2023-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -10,12 +10,13 @@ import java.util.Set; import java.util.stream.Collectors; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlOperator; +import com.google.common.collect.ImmutableSet; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperator; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.linkedin.coral.com.google.common.collect.ImmutableSet; import com.linkedin.coral.common.transformers.SqlCallTransformer; import com.linkedin.coral.hive.hive2rel.functions.VersionedSqlUserDefinedFunction; import com.linkedin.coral.spark.containers.SparkUDFInfo; diff --git a/coral-spark/src/main/java/com/linkedin/coral/spark/transformers/TransportUDFTransformer.java b/coral-spark/src/main/java/com/linkedin/coral/spark/transformers/TransportUDFTransformer.java index 54b2be17d..e324c4ed8 100644 --- a/coral-spark/src/main/java/com/linkedin/coral/spark/transformers/TransportUDFTransformer.java +++ b/coral-spark/src/main/java/com/linkedin/coral/spark/transformers/TransportUDFTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -9,8 +9,9 @@ import java.util.Collections; import java.util.Set; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperator; + import org.apache.spark.sql.SparkSession; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/coral-spark/src/test/java/com/linkedin/coral/spark/CoralSparkTest.java b/coral-spark/src/test/java/com/linkedin/coral/spark/CoralSparkTest.java index ae7801ef7..2055d48f3 100644 --- a/coral-spark/src/test/java/com/linkedin/coral/spark/CoralSparkTest.java +++ b/coral-spark/src/test/java/com/linkedin/coral/spark/CoralSparkTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -11,12 +11,14 @@ import java.util.LinkedList; import java.util.List; +import com.google.common.collect.ImmutableList; +import com.linkedin.relocated.org.apache.calcite.plan.RelOptUtil; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.sql.type.ReturnTypes; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeFamily; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; + import org.apache.avro.Schema; -import org.apache.calcite.plan.RelOptUtil; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.sql.type.ReturnTypes; -import org.apache.calcite.sql.type.SqlTypeFamily; -import org.apache.calcite.sql.type.SqlTypeName; import org.apache.commons.io.FileUtils; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.api.MetaException; @@ -25,13 +27,12 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import com.linkedin.coral.com.google.common.collect.ImmutableList; import com.linkedin.coral.hive.hive2rel.functions.StaticHiveFunctionRegistry; import com.linkedin.coral.spark.containers.SparkUDFInfo; import com.linkedin.coral.spark.exceptions.UnsupportedUDFException; import static com.linkedin.coral.spark.TestUtils.*; -import static org.apache.calcite.sql.type.OperandTypes.*; +import static com.linkedin.relocated.org.apache.calcite.sql.type.OperandTypes.*; import static org.testng.Assert.*; import static org.testng.Assert.assertEquals; diff --git a/coral-spark/src/test/java/com/linkedin/coral/spark/FuzzyUnionViewTest.java b/coral-spark/src/test/java/com/linkedin/coral/spark/FuzzyUnionViewTest.java index 0c3634b05..bd999a7b4 100644 --- a/coral-spark/src/test/java/com/linkedin/coral/spark/FuzzyUnionViewTest.java +++ b/coral-spark/src/test/java/com/linkedin/coral/spark/FuzzyUnionViewTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,7 +8,8 @@ import java.io.File; import java.io.IOException; -import org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; + import org.apache.commons.io.FileUtils; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.api.MetaException; diff --git a/coral-spark/src/test/java/com/linkedin/coral/spark/TestUtils.java b/coral-spark/src/test/java/com/linkedin/coral/spark/TestUtils.java index 46cfb55da..ee7e97a78 100644 --- a/coral-spark/src/test/java/com/linkedin/coral/spark/TestUtils.java +++ b/coral-spark/src/test/java/com/linkedin/coral/spark/TestUtils.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -9,8 +9,9 @@ import java.util.UUID; import java.util.stream.Collectors; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; + import org.apache.avro.Schema; -import org.apache.calcite.rel.RelNode; import org.apache.commons.io.FileUtils; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.api.MetaException; diff --git a/coral-trino/build.gradle b/coral-trino/build.gradle index e4e5f3ddb..3e552666b 100644 --- a/coral-trino/build.gradle +++ b/coral-trino/build.gradle @@ -1,14 +1,15 @@ dependencies { + api deps.'linkedin-calcite-core' compile deps.'gson' - compile project(path: ':coral-hive') + implementation project(':coral-hive') + implementation project(':coral-common') + implementation("com.google.code.findbugs:jsr305:3.0.2") + implementation("org.apache.commons:commons-lang3:3.12.0") + implementation(deps.'hive'.'hive-metastore') compile project(path: ':shading:coral-trino-parser', configuration: 'shadow') testCompile(deps.'hive'.'hive-exec-core') { exclude group: 'org.apache.avro', module: 'avro-tools' - // These exclusions are required to prevent duplicate classes since we include - // shaded jar above - exclude group: 'org.apache.calcite', module: 'calcite-core' - exclude group: 'org.apache.calcite', module: 'calcite-avatica' } testCompile deps.'hadoop'.'hadoop-mapreduce-client-common' diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/CoralToTrinoSqlCallConverter.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/CoralToTrinoSqlCallConverter.java index ca2cde7f6..b66ebf42e 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/CoralToTrinoSqlCallConverter.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/CoralToTrinoSqlCallConverter.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,12 +8,12 @@ import java.util.Collection; import java.util.Map; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlOperator; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.util.SqlShuttle; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperator; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.util.SqlShuttle; import com.linkedin.coral.common.functions.Function; import com.linkedin.coral.common.transformers.JsonTransformSqlCallTransformer; diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/DataTypeDerivedSqlCallConverter.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/DataTypeDerivedSqlCallConverter.java index 274a163ad..2b9acf4fc 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/DataTypeDerivedSqlCallConverter.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/DataTypeDerivedSqlCallConverter.java @@ -1,14 +1,14 @@ /** - * Copyright 2022-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2022-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.trino.rel2trino; -import org.apache.calcite.sql.SqlBasicCall; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.util.SqlShuttle; +import com.linkedin.relocated.org.apache.calcite.sql.SqlBasicCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.util.SqlShuttle; import com.linkedin.coral.common.HiveMetastoreClient; import com.linkedin.coral.common.functions.Function; diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/HiveToTrinoConverter.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/HiveToTrinoConverter.java index 30e637ab2..54cf71e38 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/HiveToTrinoConverter.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/HiveToTrinoConverter.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,7 +7,7 @@ import java.util.Map; -import org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; import com.linkedin.coral.common.HiveMetastoreClient; import com.linkedin.coral.hive.hive2rel.HiveToRelConverter; diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/RelToTrinoConverter.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/RelToTrinoConverter.java index a2b3c6145..c93ec57b4 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/RelToTrinoConverter.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/RelToTrinoConverter.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -12,23 +12,24 @@ import java.util.List; import java.util.Map; -import org.apache.calcite.rel.BiRel; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.rel.core.*; -import org.apache.calcite.rel.logical.LogicalTableFunctionScan; -import org.apache.calcite.rel.rel2sql.RelToSqlConverter; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeField; -import org.apache.calcite.rex.RexFieldAccess; -import org.apache.calcite.rex.RexLiteral; -import org.apache.calcite.rex.RexNode; -import org.apache.calcite.rex.RexProgram; -import org.apache.calcite.sql.*; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.SqlTypeName; - -import com.linkedin.coral.com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.linkedin.relocated.org.apache.calcite.rel.BiRel; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.rel.core.*; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalTableFunctionScan; +import com.linkedin.relocated.org.apache.calcite.rel.rel2sql.RelToSqlConverter; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeField; +import com.linkedin.relocated.org.apache.calcite.rex.RexFieldAccess; +import com.linkedin.relocated.org.apache.calcite.rex.RexLiteral; +import com.linkedin.relocated.org.apache.calcite.rex.RexNode; +import com.linkedin.relocated.org.apache.calcite.rex.RexProgram; +import com.linkedin.relocated.org.apache.calcite.sql.*; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; + import com.linkedin.coral.common.HiveMetastoreClient; import com.linkedin.coral.common.functions.CoralSqlUnnestOperator; import com.linkedin.coral.common.functions.FunctionFieldReferenceOperator; @@ -217,7 +218,7 @@ public Result visit(Uncollect e) { // instead of calling super.result(...), which will generate a new table alias and cause an extra // "AS" to be added to the generated SQL statement and make it invalid. return new Result(unnestCall, ImmutableList.of(Clause.FROM), null, e.getRowType(), - com.linkedin.coral.com.google.common.collect.ImmutableMap.of(projectResult.neededAlias, e.getRowType())); + ImmutableMap.of(projectResult.neededAlias, e.getRowType())); } /** diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/TrinoSqlDialect.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/TrinoSqlDialect.java index 58c66110f..78a9a04a0 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/TrinoSqlDialect.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/TrinoSqlDialect.java @@ -1,17 +1,17 @@ /** - * Copyright 2017-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.trino.rel2trino; -import org.apache.calcite.config.NullCollation; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlDialect; -import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlWriter; -import org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.config.NullCollation; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlDialect; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIdentifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlWriter; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; import static com.linkedin.coral.hive.hive2rel.functions.TimestampFromUnixtime.TIMESTAMP_FROM_UNIXTIME; diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/TrinoSqlRewriter.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/TrinoSqlRewriter.java index 20207e7fe..d2f0b1f9e 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/TrinoSqlRewriter.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/TrinoSqlRewriter.java @@ -1,5 +1,5 @@ /** - * Copyright 2018-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2018-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,15 +8,15 @@ import java.util.TimeZone; import java.util.stream.Collectors; -import org.apache.calcite.sql.SqlArrayTypeSpec; -import org.apache.calcite.sql.SqlBasicTypeNameSpec; -import org.apache.calcite.sql.SqlDataTypeSpec; -import org.apache.calcite.sql.SqlMapTypeSpec; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlRowTypeSpec; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.calcite.sql.util.SqlShuttle; +import com.linkedin.relocated.org.apache.calcite.sql.SqlArrayTypeSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlBasicTypeNameSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlDataTypeSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlMapTypeSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlRowTypeSpec; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.sql.util.SqlShuttle; /** diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/functions/GenericTemplateFunction.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/functions/GenericTemplateFunction.java index e2ec09e30..d6317f944 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/functions/GenericTemplateFunction.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/functions/GenericTemplateFunction.java @@ -1,23 +1,22 @@ /** - * Copyright 2019-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.trino.rel2trino.functions; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlCallBinding; -import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.SqlOperatorBinding; -import org.apache.calcite.sql.SqlWriter; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.SqlOperandTypeChecker; -import org.apache.calcite.sql.validate.SqlUserDefinedFunction; -import org.apache.calcite.sql.validate.SqlValidator; -import org.apache.calcite.sql.validate.SqlValidatorScope; - -import com.linkedin.coral.com.google.common.base.Preconditions; +import com.google.common.base.Preconditions; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCallBinding; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIdentifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperatorBinding; +import com.linkedin.relocated.org.apache.calcite.sql.SqlWriter; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlOperandTypeChecker; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlUserDefinedFunction; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidator; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidatorScope; /** diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/functions/RelDataTypeToTrinoTypeStringConverter.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/functions/RelDataTypeToTrinoTypeStringConverter.java index 6f835033c..0bb63f6df 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/functions/RelDataTypeToTrinoTypeStringConverter.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/functions/RelDataTypeToTrinoTypeStringConverter.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,11 +8,11 @@ import java.util.ArrayList; import java.util.List; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeField; -import org.apache.calcite.rel.type.RelRecordType; -import org.apache.calcite.sql.type.ArraySqlType; -import org.apache.calcite.sql.type.MapSqlType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeField; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelRecordType; +import com.linkedin.relocated.org.apache.calcite.sql.type.ArraySqlType; +import com.linkedin.relocated.org.apache.calcite.sql.type.MapSqlType; /** diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/functions/TrinoArrayTransformFunction.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/functions/TrinoArrayTransformFunction.java index 47f6aca91..d539587d9 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/functions/TrinoArrayTransformFunction.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/functions/TrinoArrayTransformFunction.java @@ -1,11 +1,11 @@ /** - * Copyright 2019-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.trino.rel2trino.functions; -import org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; /** diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/functions/TrinoElementAtFunction.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/functions/TrinoElementAtFunction.java index 2cbe9648a..a5933e0b9 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/functions/TrinoElementAtFunction.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/functions/TrinoElementAtFunction.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,23 +7,23 @@ import java.util.Arrays; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlCallBinding; -import org.apache.calcite.sql.SqlKind; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlOperandCountRange; -import org.apache.calcite.sql.SqlOperatorBinding; -import org.apache.calcite.sql.SqlSpecialOperator; -import org.apache.calcite.sql.SqlUtil; -import org.apache.calcite.sql.SqlWriter; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.OperandTypes; -import org.apache.calcite.sql.type.SqlOperandCountRanges; -import org.apache.calcite.sql.type.SqlSingleOperandTypeChecker; -import org.apache.calcite.sql.type.SqlTypeFamily; -import org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFactory; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCallBinding; +import com.linkedin.relocated.org.apache.calcite.sql.SqlKind; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperandCountRange; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperatorBinding; +import com.linkedin.relocated.org.apache.calcite.sql.SqlSpecialOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlUtil; +import com.linkedin.relocated.org.apache.calcite.sql.SqlWriter; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.type.OperandTypes; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlOperandCountRanges; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlSingleOperandTypeChecker; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeFamily; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; /** diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/functions/TrinoMapTransformValuesFunction.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/functions/TrinoMapTransformValuesFunction.java index 3aa82ee8c..bf3de0a97 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/functions/TrinoMapTransformValuesFunction.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/functions/TrinoMapTransformValuesFunction.java @@ -1,11 +1,11 @@ /** - * Copyright 2019-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.trino.rel2trino.functions; -import org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; /** diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/functions/TrinoStructCastRowFunction.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/functions/TrinoStructCastRowFunction.java index 785f65349..cf22ce263 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/functions/TrinoStructCastRowFunction.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/functions/TrinoStructCastRowFunction.java @@ -1,11 +1,11 @@ /** - * Copyright 2019-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.trino.rel2trino.functions; -import org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; /** diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/AsOperatorTransformer.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/AsOperatorTransformer.java index a9e17ae4d..27af57175 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/AsOperatorTransformer.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/AsOperatorTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2023-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,15 +8,15 @@ import java.util.ArrayList; import java.util.List; -import org.apache.calcite.sql.SqlBasicCall; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlKind; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.SqlBasicCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlKind; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; import com.linkedin.coral.common.transformers.SqlCallTransformer; -import static org.apache.calcite.sql.parser.SqlParserPos.*; +import static com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos.*; /** diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/CastOperatorTransformer.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/CastOperatorTransformer.java index 2edcfad64..55e868be9 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/CastOperatorTransformer.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/CastOperatorTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2023-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,24 +8,24 @@ import java.util.List; import java.util.Set; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlDataTypeSpec; -import org.apache.calcite.sql.SqlKind; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlOperator; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.type.SqlTypeName; +import com.google.common.collect.ImmutableSet; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlDataTypeSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlKind; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperator; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; -import com.linkedin.coral.com.google.common.collect.ImmutableSet; import com.linkedin.coral.common.calcite.CalciteUtil; import com.linkedin.coral.common.transformers.SqlCallTransformer; import com.linkedin.coral.common.utils.TypeDerivationUtil; -import static org.apache.calcite.sql.parser.SqlParserPos.*; -import static org.apache.calcite.sql.type.ReturnTypes.*; -import static org.apache.calcite.sql.type.SqlTypeName.*; -import static org.apache.calcite.sql.type.SqlTypeName.DOUBLE; +import static com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos.*; +import static com.linkedin.relocated.org.apache.calcite.sql.type.ReturnTypes.*; +import static com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName.*; +import static com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName.DOUBLE; /** diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/CollectListOrSetFunctionTransformer.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/CollectListOrSetFunctionTransformer.java index 2f1eb7588..6ab8b94cb 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/CollectListOrSetFunctionTransformer.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/CollectListOrSetFunctionTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,10 +8,10 @@ import java.util.ArrayList; import java.util.List; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlOperator; -import org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperator; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; import com.linkedin.coral.common.functions.FunctionReturnTypes; import com.linkedin.coral.common.transformers.SqlCallTransformer; diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/ConcatOperatorTransformer.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/ConcatOperatorTransformer.java index 9ba38a274..1da9288dc 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/ConcatOperatorTransformer.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/ConcatOperatorTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -11,20 +11,20 @@ import java.util.List; import java.util.Set; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.sql.SqlBasicTypeNameSpec; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlDataTypeSpec; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.sql.SqlBasicTypeNameSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlDataTypeSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; import com.linkedin.coral.common.HiveTypeSystem; import com.linkedin.coral.common.transformers.SqlCallTransformer; import com.linkedin.coral.common.utils.TypeDerivationUtil; -import static org.apache.calcite.rel.rel2sql.SqlImplementor.*; -import static org.apache.calcite.sql.parser.SqlParserPos.*; +import static com.linkedin.relocated.org.apache.calcite.rel.rel2sql.SqlImplementor.*; +import static com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos.*; /** diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/CurrentTimestampTransformer.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/CurrentTimestampTransformer.java index 9fa8139b4..7c9722baa 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/CurrentTimestampTransformer.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/CurrentTimestampTransformer.java @@ -1,16 +1,16 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.trino.rel2trino.transformers; -import org.apache.calcite.sql.SqlBasicTypeNameSpec; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlDataTypeSpec; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.sql.SqlBasicTypeNameSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlDataTypeSpec; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; import com.linkedin.coral.common.transformers.SqlCallTransformer; diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/FromUnixtimeOperatorTransformer.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/FromUnixtimeOperatorTransformer.java index 59eb09159..c09696811 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/FromUnixtimeOperatorTransformer.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/FromUnixtimeOperatorTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,17 +7,17 @@ import java.util.List; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlLiteral; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlOperator; -import org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlLiteral; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperator; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; import com.linkedin.coral.common.functions.FunctionReturnTypes; import com.linkedin.coral.common.transformers.SqlCallTransformer; -import static org.apache.calcite.sql.type.ReturnTypes.*; -import static org.apache.calcite.sql.type.SqlTypeName.*; +import static com.linkedin.relocated.org.apache.calcite.sql.type.ReturnTypes.*; +import static com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName.*; /** diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/FromUtcTimestampOperatorTransformer.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/FromUtcTimestampOperatorTransformer.java index eee27b50b..835dcd6fc 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/FromUtcTimestampOperatorTransformer.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/FromUtcTimestampOperatorTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2023-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -10,28 +10,28 @@ import java.util.List; import java.util.Set; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlOperator; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.type.BasicSqlType; -import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.calcite.sql.type.SqlTypeUtil; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperator; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.type.BasicSqlType; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeUtil; import com.linkedin.coral.common.HiveTypeSystem; import com.linkedin.coral.common.calcite.CalciteUtil; import com.linkedin.coral.common.transformers.SqlCallTransformer; import com.linkedin.coral.common.utils.TypeDerivationUtil; -import static org.apache.calcite.sql.fun.SqlStdOperatorTable.*; -import static org.apache.calcite.sql.parser.SqlParserPos.*; -import static org.apache.calcite.sql.type.ReturnTypes.*; -import static org.apache.calcite.sql.type.SqlTypeName.*; -import static org.apache.calcite.sql.type.SqlTypeName.BIGINT; -import static org.apache.calcite.sql.type.SqlTypeName.DATE; -import static org.apache.calcite.sql.type.SqlTypeName.DOUBLE; -import static org.apache.calcite.sql.type.SqlTypeName.INTEGER; +import static com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable.*; +import static com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos.*; +import static com.linkedin.relocated.org.apache.calcite.sql.type.ReturnTypes.*; +import static com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName.*; +import static com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName.BIGINT; +import static com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName.DATE; +import static com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName.DOUBLE; +import static com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName.INTEGER; /** diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/GenericProjectTransformer.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/GenericProjectTransformer.java index dfe08971e..dea980121 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/GenericProjectTransformer.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/GenericProjectTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,17 +8,17 @@ import java.util.ArrayList; import java.util.List; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeField; -import org.apache.calcite.rel.type.RelRecordType; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlOperator; -import org.apache.calcite.sql.type.ArraySqlType; -import org.apache.calcite.sql.type.MapSqlType; +import com.google.common.collect.ImmutableList; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeField; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelRecordType; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIdentifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperator; +import com.linkedin.relocated.org.apache.calcite.sql.type.ArraySqlType; +import com.linkedin.relocated.org.apache.calcite.sql.type.MapSqlType; -import com.linkedin.coral.com.google.common.collect.ImmutableList; import com.linkedin.coral.common.functions.GenericProjectFunction; import com.linkedin.coral.common.transformers.SqlCallTransformer; import com.linkedin.coral.common.utils.TypeDerivationUtil; @@ -28,7 +28,7 @@ import com.linkedin.coral.trino.rel2trino.functions.TrinoMapTransformValuesFunction; import com.linkedin.coral.trino.rel2trino.functions.TrinoStructCastRowFunction; -import static org.apache.calcite.sql.parser.SqlParserPos.*; +import static com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos.*; /** @@ -199,7 +199,7 @@ private SqlCall convertGenericProject(SqlCall call) { // The resolved SQL string will look like: // 'transform_values(col1, (k, v) -> transform(v , x -> cast(row(x.a) as row(a int))))' final SqlNode transformColumn = call.getOperandList().get(0); - ImmutableList transformColumnFieldFullName = ((SqlIdentifier) transformColumn).names; + ImmutableList transformColumnFieldFullName = ImmutableList.copyOf(((SqlIdentifier) transformColumn).names); String transformColumnFieldName = transformColumnFieldFullName.get(transformColumnFieldFullName.size() - 1); RelDataType fromDataType = deriveRelDatatype(transformColumn); diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/HiveUDFTransformer.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/HiveUDFTransformer.java index 0d48fd540..7dabb2b39 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/HiveUDFTransformer.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/HiveUDFTransformer.java @@ -1,14 +1,14 @@ /** - * Copyright 2023-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.trino.rel2trino.transformers; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlNodeList; -import org.apache.calcite.sql.SqlOperator; -import org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNodeList; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperator; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; import com.linkedin.coral.common.transformers.SqlCallTransformer; import com.linkedin.coral.hive.hive2rel.functions.VersionedSqlUserDefinedFunction; diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/JoinSqlCallTransformer.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/JoinSqlCallTransformer.java index 34621ba01..6a41a0f5a 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/JoinSqlCallTransformer.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/JoinSqlCallTransformer.java @@ -1,23 +1,23 @@ /** - * Copyright 2023-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.trino.rel2trino.transformers; -import org.apache.calcite.sql.JoinConditionType; -import org.apache.calcite.sql.JoinType; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.SqlJoin; -import org.apache.calcite.sql.SqlKind; -import org.apache.calcite.sql.SqlLiteral; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.JoinConditionType; +import com.linkedin.relocated.org.apache.calcite.sql.JoinType; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIdentifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlJoin; +import com.linkedin.relocated.org.apache.calcite.sql.SqlKind; +import com.linkedin.relocated.org.apache.calcite.sql.SqlLiteral; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; import com.linkedin.coral.common.transformers.SqlCallTransformer; -import static org.apache.calcite.rel.rel2sql.SqlImplementor.*; +import static com.linkedin.relocated.org.apache.calcite.rel.rel2sql.SqlImplementor.*; /** diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/MapValueConstructorTransformer.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/MapValueConstructorTransformer.java index 02ed9744e..b0ac941df 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/MapValueConstructorTransformer.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/MapValueConstructorTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,11 +8,11 @@ import java.util.ArrayList; import java.util.List; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.fun.SqlMapValueConstructor; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlMapValueConstructor; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; import com.linkedin.coral.common.transformers.SqlCallTransformer; diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/NamedStructToCastTransformer.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/NamedStructToCastTransformer.java index 27679db3e..cb65bf7c4 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/NamedStructToCastTransformer.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/NamedStructToCastTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,28 +8,28 @@ import java.util.ArrayList; import java.util.List; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.sql.SqlArrayTypeSpec; -import org.apache.calcite.sql.SqlBasicTypeNameSpec; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlCallBinding; -import org.apache.calcite.sql.SqlDataTypeSpec; -import org.apache.calcite.sql.SqlLiteral; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlRowTypeSpec; -import org.apache.calcite.sql.fun.SqlCastFunction; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.calcite.sql.type.SqlTypeUtil; -import org.apache.calcite.sql.validate.SqlValidator; -import org.apache.calcite.sql.validate.SqlValidatorScope; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.sql.SqlArrayTypeSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlBasicTypeNameSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCallBinding; +import com.linkedin.relocated.org.apache.calcite.sql.SqlDataTypeSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlLiteral; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlRowTypeSpec; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlCastFunction; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeUtil; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidator; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidatorScope; import com.linkedin.coral.common.HiveTypeSystem; import com.linkedin.coral.common.transformers.SqlCallTransformer; import com.linkedin.coral.common.utils.TypeDerivationUtil; import com.linkedin.coral.hive.hive2rel.functions.HiveNamedStructFunction; -import static org.apache.calcite.sql.parser.SqlParserPos.ZERO; +import static com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos.ZERO; /** diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/NullOrderingTransformer.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/NullOrderingTransformer.java index b3c121e99..816d855d2 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/NullOrderingTransformer.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/NullOrderingTransformer.java @@ -1,21 +1,21 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.trino.rel2trino.transformers; -import org.apache.calcite.sql.SqlBasicCall; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlKind; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlNodeList; -import org.apache.calcite.sql.SqlSelect; -import org.apache.calcite.sql.SqlWindow; +import com.linkedin.relocated.org.apache.calcite.sql.SqlBasicCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlKind; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNodeList; +import com.linkedin.relocated.org.apache.calcite.sql.SqlSelect; +import com.linkedin.relocated.org.apache.calcite.sql.SqlWindow; import com.linkedin.coral.common.transformers.SqlCallTransformer; -import static org.apache.calcite.rel.rel2sql.SqlImplementor.*; +import static com.linkedin.relocated.org.apache.calcite.rel.rel2sql.SqlImplementor.*; /** diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/ReturnTypeAdjustmentTransformer.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/ReturnTypeAdjustmentTransformer.java index 4ddf342c4..e5ae7d948 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/ReturnTypeAdjustmentTransformer.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/ReturnTypeAdjustmentTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -9,14 +9,13 @@ import java.util.Map; import com.google.common.collect.ImmutableMap; - -import org.apache.calcite.sql.SqlBasicTypeNameSpec; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlDataTypeSpec; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.sql.SqlBasicTypeNameSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlDataTypeSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; import com.linkedin.coral.common.transformers.SqlCallTransformer; diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/SqlSelectAliasAppenderTransformer.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/SqlSelectAliasAppenderTransformer.java index 68e7db2d0..d62c75058 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/SqlSelectAliasAppenderTransformer.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/SqlSelectAliasAppenderTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,18 +8,18 @@ import java.util.ArrayList; import java.util.List; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.SqlKind; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlNodeList; -import org.apache.calcite.sql.SqlSelect; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.validate.SqlValidatorUtil; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIdentifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlKind; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNodeList; +import com.linkedin.relocated.org.apache.calcite.sql.SqlSelect; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidatorUtil; import com.linkedin.coral.common.transformers.SqlCallTransformer; -import static org.apache.calcite.rel.rel2sql.SqlImplementor.*; +import static com.linkedin.relocated.org.apache.calcite.rel.rel2sql.SqlImplementor.*; /** diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/SubstrIndexTransformer.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/SubstrIndexTransformer.java index 1acb156b6..3e8523307 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/SubstrIndexTransformer.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/SubstrIndexTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2023-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -9,18 +9,18 @@ import java.util.List; import java.util.Set; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlNumericLiteral; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.google.common.collect.ImmutableSet; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIdentifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNumericLiteral; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; -import com.linkedin.coral.com.google.common.collect.ImmutableSet; import com.linkedin.coral.common.calcite.CalciteUtil; import com.linkedin.coral.common.transformers.SqlCallTransformer; -import static org.apache.calcite.rel.rel2sql.SqlImplementor.*; -import static org.apache.calcite.sql.fun.SqlStdOperatorTable.*; +import static com.linkedin.relocated.org.apache.calcite.rel.rel2sql.SqlImplementor.*; +import static com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable.*; /** diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/SubstrOperatorTransformer.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/SubstrOperatorTransformer.java index 6e4c3d834..c2524c9ab 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/SubstrOperatorTransformer.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/SubstrOperatorTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -11,21 +11,21 @@ import java.util.List; import java.util.Set; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.sql.SqlBasicTypeNameSpec; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlDataTypeSpec; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.sql.SqlBasicTypeNameSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlDataTypeSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; import com.linkedin.coral.common.HiveTypeSystem; import com.linkedin.coral.common.transformers.SqlCallTransformer; import com.linkedin.coral.common.utils.TypeDerivationUtil; -import static org.apache.calcite.sql.parser.SqlParserPos.*; -import static org.apache.calcite.sql.type.SqlTypeName.*; +import static com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos.*; +import static com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName.*; /** diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/ToDateOperatorTransformer.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/ToDateOperatorTransformer.java index bccbc846c..51e0ad5f4 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/ToDateOperatorTransformer.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/ToDateOperatorTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,16 +8,16 @@ import java.util.ArrayList; import java.util.List; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlOperator; -import org.apache.calcite.sql.SqlWriter; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.OperandTypes; -import org.apache.calcite.sql.validate.SqlUserDefinedFunction; +import com.google.common.base.Preconditions; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIdentifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperator; +import com.linkedin.relocated.org.apache.calcite.sql.SqlWriter; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.type.OperandTypes; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlUserDefinedFunction; -import com.linkedin.coral.com.google.common.base.Preconditions; import com.linkedin.coral.common.functions.FunctionReturnTypes; import com.linkedin.coral.common.transformers.SqlCallTransformer; import com.linkedin.coral.hive.hive2rel.functions.StaticHiveFunctionRegistry; diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/UnionSqlCallTransformer.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/UnionSqlCallTransformer.java index 61bcd3427..4266c7f26 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/UnionSqlCallTransformer.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/UnionSqlCallTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -9,29 +9,29 @@ import java.util.List; import java.util.Optional; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.sql.SqlBasicTypeNameSpec; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlCallBinding; -import org.apache.calcite.sql.SqlDataTypeSpec; -import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.SqlKind; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlNodeList; -import org.apache.calcite.sql.SqlSelect; -import org.apache.calcite.sql.SqlTypeNameSpec; -import org.apache.calcite.sql.fun.SqlCastFunction; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.calcite.sql.validate.SqlValidator; -import org.apache.calcite.sql.validate.SqlValidatorScope; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.sql.SqlBasicTypeNameSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCallBinding; +import com.linkedin.relocated.org.apache.calcite.sql.SqlDataTypeSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIdentifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlKind; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNodeList; +import com.linkedin.relocated.org.apache.calcite.sql.SqlSelect; +import com.linkedin.relocated.org.apache.calcite.sql.SqlTypeNameSpec; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlCastFunction; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidator; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidatorScope; import com.linkedin.coral.common.transformers.SqlCallTransformer; import com.linkedin.coral.common.utils.TypeDerivationUtil; -import static org.apache.calcite.rel.rel2sql.SqlImplementor.POS; -import static org.apache.calcite.sql.parser.SqlParserPos.ZERO; +import static com.linkedin.relocated.org.apache.calcite.rel.rel2sql.SqlImplementor.POS; +import static com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos.ZERO; /** diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/UnnestOperatorTransformer.java b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/UnnestOperatorTransformer.java index 6da189285..1dd67cce4 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/UnnestOperatorTransformer.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/transformers/UnnestOperatorTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -9,22 +9,21 @@ import java.util.Collections; import com.google.common.collect.ImmutableList; - -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeFieldImpl; -import org.apache.calcite.rel.type.RelRecordType; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlCharStringLiteral; -import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.SqlLiteral; -import org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFieldImpl; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelRecordType; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCharStringLiteral; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIdentifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlLiteral; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; import com.linkedin.coral.common.functions.CoralSqlUnnestOperator; import com.linkedin.coral.common.transformers.SqlCallTransformer; import com.linkedin.coral.trino.rel2trino.TrinoSqlDialect; import com.linkedin.coral.trino.rel2trino.functions.TrinoArrayTransformFunction; -import static org.apache.calcite.rel.rel2sql.SqlImplementor.*; +import static com.linkedin.relocated.org.apache.calcite.rel.rel2sql.SqlImplementor.*; /** diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/OperatorTransformer.java b/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/OperatorTransformer.java index f139d3cfa..d28091c47 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/OperatorTransformer.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/OperatorTransformer.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -20,12 +20,11 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.google.gson.JsonPrimitive; - -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlOperator; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperator; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; import static com.linkedin.coral.common.calcite.CalciteUtil.*; diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/Trino2CoralOperatorConverter.java b/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/Trino2CoralOperatorConverter.java index 11d7e2da7..fc1f323e1 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/Trino2CoralOperatorConverter.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/Trino2CoralOperatorConverter.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,9 +7,9 @@ import java.util.Locale; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.util.SqlShuttle; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.util.SqlShuttle; /** diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/Trino2CoralOperatorTransformerMap.java b/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/Trino2CoralOperatorTransformerMap.java index 8b7492950..39c933aaa 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/Trino2CoralOperatorTransformerMap.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/Trino2CoralOperatorTransformerMap.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,10 +8,10 @@ import java.util.HashMap; import java.util.Map; -import org.apache.calcite.sql.type.ReturnTypes; +import com.linkedin.relocated.org.apache.calcite.sql.type.ReturnTypes; import static com.linkedin.coral.trino.trino2rel.Trino2CoralOperatorTransformerMapUtils.*; -import static org.apache.calcite.sql.type.OperandTypes.*; +import static com.linkedin.relocated.org.apache.calcite.sql.type.OperandTypes.*; public class Trino2CoralOperatorTransformerMap { diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/Trino2CoralOperatorTransformerMapUtils.java b/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/Trino2CoralOperatorTransformerMapUtils.java index 376c8bcdd..451113ab9 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/Trino2CoralOperatorTransformerMapUtils.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/Trino2CoralOperatorTransformerMapUtils.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,12 +7,12 @@ import java.util.Map; -import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.SqlOperator; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.SqlOperandTypeChecker; -import org.apache.calcite.sql.type.SqlReturnTypeInference; -import org.apache.calcite.sql.validate.SqlUserDefinedFunction; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIdentifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperator; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlOperandTypeChecker; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlReturnTypeInference; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlUserDefinedFunction; public class Trino2CoralOperatorTransformerMapUtils { diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/TrinoSqlConformance.java b/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/TrinoSqlConformance.java index b37151652..0a2b63a3e 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/TrinoSqlConformance.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/TrinoSqlConformance.java @@ -1,13 +1,13 @@ /** - * Copyright 2021-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2021-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ package com.linkedin.coral.trino.trino2rel; -import org.apache.calcite.sql.validate.SqlConformance; -import org.apache.calcite.sql.validate.SqlConformanceEnum; -import org.apache.calcite.sql.validate.SqlDelegatingConformance; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlConformance; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlConformanceEnum; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlDelegatingConformance; public class TrinoSqlConformance extends SqlDelegatingConformance { diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/TrinoSqlToRelConverter.java b/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/TrinoSqlToRelConverter.java index ae6e9447b..d302bda30 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/TrinoSqlToRelConverter.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/TrinoSqlToRelConverter.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,31 +8,31 @@ import java.util.ArrayList; import java.util.List; -import org.apache.calcite.linq4j.Ord; -import org.apache.calcite.plan.Convention; -import org.apache.calcite.plan.RelOptCluster; -import org.apache.calcite.plan.RelOptTable; -import org.apache.calcite.plan.RelOptUtil; -import org.apache.calcite.prepare.Prepare; -import org.apache.calcite.rel.RelCollation; -import org.apache.calcite.rel.RelCollations; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.rel.RelRoot; -import org.apache.calcite.rel.core.Uncollect; -import org.apache.calcite.rel.logical.LogicalValues; -import org.apache.calcite.rel.metadata.JaninoRelMetadataProvider; -import org.apache.calcite.rel.metadata.RelMetadataQuery; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rex.RexNode; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlExplainFormat; -import org.apache.calcite.sql.SqlExplainLevel; -import org.apache.calcite.sql.SqlKind; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlUnnestOperator; -import org.apache.calcite.sql.validate.SqlValidator; -import org.apache.calcite.sql2rel.SqlRexConvertletTable; -import org.apache.calcite.sql2rel.SqlToRelConverter; +import com.linkedin.relocated.org.apache.calcite.linq4j.Ord; +import com.linkedin.relocated.org.apache.calcite.plan.Convention; +import com.linkedin.relocated.org.apache.calcite.plan.RelOptCluster; +import com.linkedin.relocated.org.apache.calcite.plan.RelOptTable; +import com.linkedin.relocated.org.apache.calcite.plan.RelOptUtil; +import com.linkedin.relocated.org.apache.calcite.prepare.Prepare; +import com.linkedin.relocated.org.apache.calcite.rel.RelCollation; +import com.linkedin.relocated.org.apache.calcite.rel.RelCollations; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.rel.RelRoot; +import com.linkedin.relocated.org.apache.calcite.rel.core.Uncollect; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalValues; +import com.linkedin.relocated.org.apache.calcite.rel.metadata.JaninoRelMetadataProvider; +import com.linkedin.relocated.org.apache.calcite.rel.metadata.RelMetadataQuery; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rex.RexNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlExplainFormat; +import com.linkedin.relocated.org.apache.calcite.sql.SqlExplainLevel; +import com.linkedin.relocated.org.apache.calcite.sql.SqlKind; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlUnnestOperator; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidator; +import com.linkedin.relocated.org.apache.calcite.sql2rel.SqlRexConvertletTable; +import com.linkedin.relocated.org.apache.calcite.sql2rel.SqlToRelConverter; import com.linkedin.coral.common.HiveUncollect; import com.linkedin.coral.hive.hive2rel.functions.HiveExplodeOperator; diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/TrinoToRelConverter.java b/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/TrinoToRelConverter.java index 25c2b6436..87f2f6514 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/TrinoToRelConverter.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/TrinoToRelConverter.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -9,16 +9,17 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.apache.calcite.adapter.java.JavaTypeFactory; -import org.apache.calcite.plan.RelOptCluster; -import org.apache.calcite.plan.volcano.VolcanoPlanner; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlOperatorTable; -import org.apache.calcite.sql.fun.SqlStdOperatorTable; -import org.apache.calcite.sql.util.ChainedSqlOperatorTable; -import org.apache.calcite.sql.validate.SqlValidator; -import org.apache.calcite.sql2rel.SqlRexConvertletTable; -import org.apache.calcite.sql2rel.SqlToRelConverter; +import com.linkedin.relocated.org.apache.calcite.adapter.java.JavaTypeFactory; +import com.linkedin.relocated.org.apache.calcite.plan.RelOptCluster; +import com.linkedin.relocated.org.apache.calcite.plan.volcano.VolcanoPlanner; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.util.ChainedSqlOperatorTable; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlValidator; +import com.linkedin.relocated.org.apache.calcite.sql2rel.SqlRexConvertletTable; +import com.linkedin.relocated.org.apache.calcite.sql2rel.SqlToRelConverter; + import org.apache.hadoop.hive.metastore.api.Table; import com.linkedin.coral.common.HiveMetastoreClient; diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/TrinoViewExpander.java b/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/TrinoViewExpander.java index bdd5863f5..0fbd07c4e 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/TrinoViewExpander.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/TrinoViewExpander.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -10,12 +10,11 @@ import javax.annotation.Nonnull; import com.google.common.base.Preconditions; - -import org.apache.calcite.plan.RelOptTable; -import org.apache.calcite.rel.RelRoot; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.util.Util; +import com.linkedin.relocated.org.apache.calcite.plan.RelOptTable; +import com.linkedin.relocated.org.apache.calcite.rel.RelRoot; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.util.Util; import com.linkedin.coral.common.FuzzyUnionSqlRewriter; diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/parsetree/ParseTreeBuilder.java b/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/parsetree/ParseTreeBuilder.java index 67924fa21..61c054102 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/parsetree/ParseTreeBuilder.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/parsetree/ParseTreeBuilder.java @@ -1,5 +1,5 @@ /** - * Copyright 2021-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2021-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -12,16 +12,16 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; +import com.linkedin.relocated.org.apache.calcite.avatica.util.TimeUnit; +import com.linkedin.relocated.org.apache.calcite.sql.*; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParseException; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeFactoryImpl; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeUtil; +import com.linkedin.relocated.org.apache.calcite.util.TimeString; +import com.linkedin.relocated.org.apache.calcite.util.TimestampString; -import org.apache.calcite.avatica.util.TimeUnit; -import org.apache.calcite.sql.*; -import org.apache.calcite.sql.parser.SqlParseException; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.type.SqlTypeFactoryImpl; -import org.apache.calcite.sql.type.SqlTypeName; -import org.apache.calcite.sql.type.SqlTypeUtil; -import org.apache.calcite.util.TimeString; -import org.apache.calcite.util.TimestampString; import org.apache.commons.lang3.ObjectUtils; import com.linkedin.coral.common.HiveTypeSystem; @@ -30,10 +30,10 @@ import coral.shading.io.trino.sql.tree.*; import static com.linkedin.coral.common.calcite.CalciteUtil.*; +import static com.linkedin.relocated.org.apache.calcite.sql.SqlFunctionCategory.USER_DEFINED_FUNCTION; +import static com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable.*; +import static com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos.ZERO; import static java.lang.String.format; -import static org.apache.calcite.sql.SqlFunctionCategory.USER_DEFINED_FUNCTION; -import static org.apache.calcite.sql.fun.SqlStdOperatorTable.*; -import static org.apache.calcite.sql.parser.SqlParserPos.ZERO; public class ParseTreeBuilder extends AstVisitor { diff --git a/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/parsetree/ParserVisitorContext.java b/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/parsetree/ParserVisitorContext.java index 190268886..559b11d63 100644 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/parsetree/ParserVisitorContext.java +++ b/coral-trino/src/main/java/com/linkedin/coral/trino/trino2rel/parsetree/ParserVisitorContext.java @@ -1,5 +1,5 @@ /** - * Copyright 2021-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2021-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -8,13 +8,13 @@ import java.util.ArrayList; import java.util.List; -import org.apache.calcite.sql.*; -import org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.*; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; import com.linkedin.coral.common.calcite.CalciteUtil; -import static org.apache.calcite.sql.fun.SqlStdOperatorTable.CASE; -import static org.apache.calcite.sql.parser.SqlParserPos.ZERO; +import static com.linkedin.relocated.org.apache.calcite.sql.fun.SqlStdOperatorTable.CASE; +import static com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos.ZERO; public class ParserVisitorContext { diff --git a/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/HiveToTrinoConverterTest.java b/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/HiveToTrinoConverterTest.java index 6bec9b880..10a88d90a 100644 --- a/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/HiveToTrinoConverterTest.java +++ b/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/HiveToTrinoConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -9,10 +9,10 @@ import java.io.IOException; import com.google.common.collect.ImmutableMap; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.sql.type.ReturnTypes; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeFamily; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.sql.type.ReturnTypes; -import org.apache.calcite.sql.type.SqlTypeFamily; import org.apache.commons.io.FileUtils; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.api.MetaException; @@ -25,7 +25,7 @@ import com.linkedin.coral.hive.hive2rel.functions.StaticHiveFunctionRegistry; import static com.linkedin.coral.trino.rel2trino.CoralTrinoConfigKeys.*; -import static org.apache.calcite.sql.type.OperandTypes.*; +import static com.linkedin.relocated.org.apache.calcite.sql.type.OperandTypes.*; import static org.testng.Assert.assertEquals; diff --git a/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/RelToTrinoConverterTest.java b/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/RelToTrinoConverterTest.java index eca6cda9c..5eee5c100 100644 --- a/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/RelToTrinoConverterTest.java +++ b/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/RelToTrinoConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,8 +7,9 @@ import java.io.IOException; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.tools.FrameworkConfig; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.tools.FrameworkConfig; + import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.ql.metadata.HiveException; diff --git a/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/TestTable.java b/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/TestTable.java index c61d7885c..e69cf0c43 100644 --- a/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/TestTable.java +++ b/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/TestTable.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -10,17 +10,16 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; - -import org.apache.calcite.config.CalciteConnectionConfig; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeFactory; -import org.apache.calcite.schema.Schema; -import org.apache.calcite.schema.Statistic; -import org.apache.calcite.schema.Statistics; -import org.apache.calcite.schema.Table; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.type.SqlTypeName; +import com.linkedin.relocated.org.apache.calcite.config.CalciteConnectionConfig; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFactory; +import com.linkedin.relocated.org.apache.calcite.schema.Schema; +import com.linkedin.relocated.org.apache.calcite.schema.Statistic; +import com.linkedin.relocated.org.apache.calcite.schema.Statistics; +import com.linkedin.relocated.org.apache.calcite.schema.Table; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; /** diff --git a/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/TestUtils.java b/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/TestUtils.java index 2bb368e13..7dc86c91b 100644 --- a/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/TestUtils.java +++ b/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/TestUtils.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2024 LinkedIn Corporation. All rights reserved. + * Copyright 2017-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -17,19 +17,19 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; +import com.linkedin.relocated.org.apache.calcite.plan.RelTraitDef; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.rel.RelRoot; +import com.linkedin.relocated.org.apache.calcite.runtime.Hook; +import com.linkedin.relocated.org.apache.calcite.schema.SchemaPlus; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParser; +import com.linkedin.relocated.org.apache.calcite.sql.validate.SqlConformanceEnum; +import com.linkedin.relocated.org.apache.calcite.tools.FrameworkConfig; +import com.linkedin.relocated.org.apache.calcite.tools.Frameworks; +import com.linkedin.relocated.org.apache.calcite.tools.Planner; +import com.linkedin.relocated.org.apache.calcite.tools.Programs; -import org.apache.calcite.plan.RelTraitDef; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.rel.RelRoot; -import org.apache.calcite.runtime.Hook; -import org.apache.calcite.schema.SchemaPlus; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.parser.SqlParser; -import org.apache.calcite.sql.validate.SqlConformanceEnum; -import org.apache.calcite.tools.FrameworkConfig; -import org.apache.calcite.tools.Frameworks; -import org.apache.calcite.tools.Planner; -import org.apache.calcite.tools.Programs; import org.apache.commons.io.FileUtils; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.api.MetaException; diff --git a/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/functions/RelDataTypeToTrinoTypeStringConverterTest.java b/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/functions/RelDataTypeToTrinoTypeStringConverterTest.java index ba6f69c66..473148986 100644 --- a/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/functions/RelDataTypeToTrinoTypeStringConverterTest.java +++ b/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/functions/RelDataTypeToTrinoTypeStringConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2019-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2019-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -11,16 +11,16 @@ import com.google.common.collect.ImmutableMultimap; import com.google.common.collect.Multimap; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataType; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeField; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeFieldImpl; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelDataTypeSystem; +import com.linkedin.relocated.org.apache.calcite.rel.type.RelRecordType; +import com.linkedin.relocated.org.apache.calcite.sql.type.ArraySqlType; +import com.linkedin.relocated.org.apache.calcite.sql.type.BasicSqlType; +import com.linkedin.relocated.org.apache.calcite.sql.type.MapSqlType; +import com.linkedin.relocated.org.apache.calcite.sql.type.SqlTypeName; -import org.apache.calcite.rel.type.RelDataType; -import org.apache.calcite.rel.type.RelDataTypeField; -import org.apache.calcite.rel.type.RelDataTypeFieldImpl; -import org.apache.calcite.rel.type.RelDataTypeSystem; -import org.apache.calcite.rel.type.RelRecordType; -import org.apache.calcite.sql.type.ArraySqlType; -import org.apache.calcite.sql.type.BasicSqlType; -import org.apache.calcite.sql.type.MapSqlType; -import org.apache.calcite.sql.type.SqlTypeName; import org.testng.annotations.Test; import static org.testng.Assert.*; diff --git a/coral-trino/src/test/java/com/linkedin/coral/trino/trino2rel/TrinoToRelConverterTest.java b/coral-trino/src/test/java/com/linkedin/coral/trino/trino2rel/TrinoToRelConverterTest.java index da8ca31fb..788292d54 100644 --- a/coral-trino/src/test/java/com/linkedin/coral/trino/trino2rel/TrinoToRelConverterTest.java +++ b/coral-trino/src/test/java/com/linkedin/coral/trino/trino2rel/TrinoToRelConverterTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2021-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2021-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -11,10 +11,10 @@ import java.util.Map; import com.google.common.collect.ImmutableList; +import com.linkedin.relocated.org.apache.calcite.plan.RelOptUtil; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.sql.type.ReturnTypes; -import org.apache.calcite.plan.RelOptUtil; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.sql.type.ReturnTypes; import org.apache.commons.io.FileUtils; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.api.MetaException; @@ -30,7 +30,7 @@ import static com.linkedin.coral.trino.trino2rel.ToRelTestUtils.*; import static com.linkedin.coral.trino.trino2rel.Trino2CoralOperatorTransformerMapUtils.*; -import static org.apache.calcite.sql.type.OperandTypes.*; +import static com.linkedin.relocated.org.apache.calcite.sql.type.OperandTypes.*; import static org.testng.AssertJUnit.assertEquals; diff --git a/coral-trino/src/test/java/com/linkedin/coral/trino/trino2rel/parsetree/ParseTreeBuilderTest.java b/coral-trino/src/test/java/com/linkedin/coral/trino/trino2rel/parsetree/ParseTreeBuilderTest.java index 1a3196dfa..378b75b23 100644 --- a/coral-trino/src/test/java/com/linkedin/coral/trino/trino2rel/parsetree/ParseTreeBuilderTest.java +++ b/coral-trino/src/test/java/com/linkedin/coral/trino/trino2rel/parsetree/ParseTreeBuilderTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2021-2023 LinkedIn Corporation. All rights reserved. + * Copyright 2021-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -10,8 +10,8 @@ import java.util.List; import com.google.common.collect.ImmutableList; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlNode; import org.apache.commons.io.IOUtils; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; diff --git a/coral-visualization/build.gradle b/coral-visualization/build.gradle index 82c8b67ce..89db9d330 100644 --- a/coral-visualization/build.gradle +++ b/coral-visualization/build.gradle @@ -4,10 +4,8 @@ dependencies { compile project(path: ':coral-hive') testCompile (deps.'hive'.'hive-exec-core') { exclude group: 'org.apache.avro', module: 'avro-tools' - // This exclusion is required to prevent duplicate classes since we include - // shaded 'calcite-core' transitively - exclude group: 'org.apache.calcite', module: 'calcite-core' } testCompile deps.'hadoop'.'hadoop-mapreduce-client-core' testCompile deps.'kryo' + testImplementation('org.apache.commons:commons-lang3:3.12.0') } diff --git a/coral-visualization/src/main/java/com/linkedin/coral/vis/RelNodeVisualizationShuttle.java b/coral-visualization/src/main/java/com/linkedin/coral/vis/RelNodeVisualizationShuttle.java index 7b678c1ee..f451adf7a 100644 --- a/coral-visualization/src/main/java/com/linkedin/coral/vis/RelNodeVisualizationShuttle.java +++ b/coral-visualization/src/main/java/com/linkedin/coral/vis/RelNodeVisualizationShuttle.java @@ -1,5 +1,5 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -11,20 +11,20 @@ import java.util.Map; import java.util.UUID; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.rel.RelShuttleImpl; -import org.apache.calcite.rel.core.TableFunctionScan; -import org.apache.calcite.rel.core.TableScan; -import org.apache.calcite.rel.logical.LogicalAggregate; -import org.apache.calcite.rel.logical.LogicalCorrelate; -import org.apache.calcite.rel.logical.LogicalFilter; -import org.apache.calcite.rel.logical.LogicalIntersect; -import org.apache.calcite.rel.logical.LogicalJoin; -import org.apache.calcite.rel.logical.LogicalMinus; -import org.apache.calcite.rel.logical.LogicalProject; -import org.apache.calcite.rel.logical.LogicalSort; -import org.apache.calcite.rel.logical.LogicalUnion; -import org.apache.calcite.rel.logical.LogicalValues; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.rel.RelShuttleImpl; +import com.linkedin.relocated.org.apache.calcite.rel.core.TableFunctionScan; +import com.linkedin.relocated.org.apache.calcite.rel.core.TableScan; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalAggregate; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalCorrelate; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalFilter; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalIntersect; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalJoin; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalMinus; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalProject; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalSort; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalUnion; +import com.linkedin.relocated.org.apache.calcite.rel.logical.LogicalValues; import com.linkedin.coral.common.HiveUncollect; diff --git a/coral-visualization/src/main/java/com/linkedin/coral/vis/SqlNodeVisualizationVisitor.java b/coral-visualization/src/main/java/com/linkedin/coral/vis/SqlNodeVisualizationVisitor.java index a2ca9ade2..b2330194d 100644 --- a/coral-visualization/src/main/java/com/linkedin/coral/vis/SqlNodeVisualizationVisitor.java +++ b/coral-visualization/src/main/java/com/linkedin/coral/vis/SqlNodeVisualizationVisitor.java @@ -1,5 +1,5 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -10,19 +10,19 @@ import java.util.List; import java.util.UUID; -import org.apache.calcite.sql.SqlBasicCall; -import org.apache.calcite.sql.SqlCall; -import org.apache.calcite.sql.SqlDataTypeSpec; -import org.apache.calcite.sql.SqlDynamicParam; -import org.apache.calcite.sql.SqlIdentifier; -import org.apache.calcite.sql.SqlIntervalQualifier; -import org.apache.calcite.sql.SqlJoin; -import org.apache.calcite.sql.SqlLiteral; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.SqlNodeList; -import org.apache.calcite.sql.SqlSelect; -import org.apache.calcite.sql.parser.SqlParserPos; -import org.apache.calcite.sql.util.SqlVisitor; +import com.linkedin.relocated.org.apache.calcite.sql.SqlBasicCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlCall; +import com.linkedin.relocated.org.apache.calcite.sql.SqlDataTypeSpec; +import com.linkedin.relocated.org.apache.calcite.sql.SqlDynamicParam; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIdentifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlIntervalQualifier; +import com.linkedin.relocated.org.apache.calcite.sql.SqlJoin; +import com.linkedin.relocated.org.apache.calcite.sql.SqlLiteral; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNodeList; +import com.linkedin.relocated.org.apache.calcite.sql.SqlSelect; +import com.linkedin.relocated.org.apache.calcite.sql.parser.SqlParserPos; +import com.linkedin.relocated.org.apache.calcite.sql.util.SqlVisitor; import guru.nidi.graphviz.attribute.Label; import guru.nidi.graphviz.model.Factory; diff --git a/coral-visualization/src/main/java/com/linkedin/coral/vis/VisualizationUtil.java b/coral-visualization/src/main/java/com/linkedin/coral/vis/VisualizationUtil.java index f13f19482..2c0b72cc8 100644 --- a/coral-visualization/src/main/java/com/linkedin/coral/vis/VisualizationUtil.java +++ b/coral-visualization/src/main/java/com/linkedin/coral/vis/VisualizationUtil.java @@ -1,5 +1,5 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -7,9 +7,9 @@ import java.io.File; -import org.apache.calcite.rel.RelNode; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.util.SqlVisitor; +import com.linkedin.relocated.org.apache.calcite.rel.RelNode; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.util.SqlVisitor; import guru.nidi.graphviz.attribute.Font; import guru.nidi.graphviz.attribute.Shape; diff --git a/coral-visualization/src/test/java/com/linkedin/coral/vis/TestUtils.java b/coral-visualization/src/test/java/com/linkedin/coral/vis/TestUtils.java index 4e99f0c3b..8d29a74b2 100644 --- a/coral-visualization/src/test/java/com/linkedin/coral/vis/TestUtils.java +++ b/coral-visualization/src/test/java/com/linkedin/coral/vis/TestUtils.java @@ -1,5 +1,5 @@ /** - * Copyright 2023 LinkedIn Corporation. All rights reserved. + * Copyright 2023-2025 LinkedIn Corporation. All rights reserved. * Licensed under the BSD-2 Clause license. * See LICENSE in the project root for license information. */ @@ -12,9 +12,9 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; +import com.linkedin.relocated.org.apache.calcite.sql.SqlNode; +import com.linkedin.relocated.org.apache.calcite.sql.util.SqlVisitor; -import org.apache.calcite.sql.SqlNode; -import org.apache.calcite.sql.util.SqlVisitor; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.ql.metadata.Hive; diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index f6e70d1f4..f285ac9c2 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -9,7 +9,7 @@ def versions = [ 'jetbrains': '16.0.2', 'jline': '0.9.94', 'kryo': '2.22', - 'linkedin-calcite-core': '1.21.0.265', + 'linkedin-calcite-core': '1.21.0.270', 'pig': '0.15.0', 'spark': '2.4.0', 'spark3': '3.1.1', @@ -29,13 +29,15 @@ ext.deps = [ ], 'hive':[ 'hive-metastore': "org.apache.hive:hive-metastore:${versions['hive']}", - 'hive-exec-core': "org.apache.hive:hive-exec:${versions['hive']}:core" + 'hive-exec-core': "org.apache.hive:hive-exec:${versions['hive']}:core", + 'hive-exec': "org.apache.hive:hive-exec:${versions['hive']}", + 'hive-serde': "org.apache.hive:hive-serde:${versions['hive']}", ], 'ivy': "org.apache.ivy:ivy:${versions['ivy']}", 'jetbrains': "org.jetbrains:annotations:${versions['jetbrains']}", 'jline': "jline:jline:${versions['jline']}", 'kryo': "com.esotericsoftware.kryo:kryo:${versions['kryo']}", - 'linkedin-calcite-core': "com.linkedin.calcite:calcite-core:${versions['linkedin-calcite-core']}", + 'linkedin-calcite-core': "com.linkedin.calcite:calcite-core:${versions['linkedin-calcite-core']}:shaded-all", 'pig': [ 'pig': "org.apache.pig:pig:${versions['pig']}:h2", 'pigunit': "org.apache.pig:pigunit:${versions['pig']}" diff --git a/gradle/java-publication.gradle b/gradle/java-publication.gradle index 930827f1a..0375a171a 100644 --- a/gradle/java-publication.gradle +++ b/gradle/java-publication.gradle @@ -1,4 +1,4 @@ -apply plugin: "java" +apply plugin: "java-library" def licenseSpec = copySpec { from project.rootDir