diff --git a/README.md b/README.md index c6f03be4b..678aa1f0f 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,20 @@ and implementing query rewrite algorithms for data governance and query optimiza - Coral-Visualization [WIP]: Visualizes Coral SqlNode and RelNode trees and renders them to an output file. - Coral-Service: Service that exposes REST APIs that allow users to interact with Coral (see [Coral-as-a-Service](#Coral-as-a-Service) for more details). +## Version Upgrades + +This project adheres to semantic versioning, where the format x.y.z represents major, minor, and patch version upgrades. Consideration should be given to potential changes required when integrating different versions of this project. + +**'y' Upgrade** + +An 'y' upgrade represents a version change that introduces backward incompatibility by removal or modification of methods. + +**'x' Upgrade** + +An 'x' upgrade signifies a version change that introduces backward incompatibility by affecting the availability of classes. + +Please carefully review the release notes and documentation accompanying each version upgrade to understand the specific changes and the recommended steps for migration. + ## How to Build 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 76a3fddbc..279f20768 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 @@ -25,7 +25,7 @@ public static String translateTrinoToSpark(String query) { public static String translateHiveToTrino(String query) { RelNode relNode = new HiveToRelConverter(hiveMetastoreClient).convertSql(query); - return new RelToTrinoConverter().convert(relNode); + return new RelToTrinoConverter(hiveMetastoreClient).convert(relNode); } public static String translateHiveToSpark(String query) { 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 2d7f389e9..30e637ab2 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 @@ -23,7 +23,7 @@ public class HiveToTrinoConverter { public static HiveToTrinoConverter create(HiveMetastoreClient mscClient) { checkNotNull(mscClient); HiveToRelConverter hiveToRelConverter = new HiveToRelConverter(mscClient); - RelToTrinoConverter relToTrinoConverter = new RelToTrinoConverter(); + RelToTrinoConverter relToTrinoConverter = new RelToTrinoConverter(mscClient); return new HiveToTrinoConverter(hiveToRelConverter, relToTrinoConverter); } @@ -31,7 +31,7 @@ public static HiveToTrinoConverter create(HiveMetastoreClient mscClient, Map configs = new HashMap<>(); + private HiveMetastoreClient _hiveMetastoreClient; /** * Creates a RelToTrinoConverter. + * @param mscClient client interface used to interact with the Hive Metastore service. */ - public RelToTrinoConverter() { + public RelToTrinoConverter(HiveMetastoreClient mscClient) { super(TrinoSqlDialect.INSTANCE); + _hiveMetastoreClient = mscClient; } - public RelToTrinoConverter(Map configs) { + /** + * Creates a RelToTrinoConverter. + * @param mscClient client interface used to interact with the Hive Metastore service. + * @param configs configs + */ + public RelToTrinoConverter(HiveMetastoreClient mscClient, Map configs) { super(TrinoSqlDialect.INSTANCE); checkNotNull(configs); this.configs = configs; + _hiveMetastoreClient = mscClient; } /** 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 ad882fac9..871d93321 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 @@ -768,7 +768,7 @@ public void testCastVarbinaryToChar() { @Test public void testRlikeTransformation() { - RelToTrinoConverter relToTrinoConverter = new RelToTrinoConverter(); + RelToTrinoConverter relToTrinoConverter = TestUtils.getRelToTrinoConverter(); RelNode relNode = TestUtils.getHiveToRelConverter().convertSql("SELECT '1' NOT RLIKE '^1$'"); String targetSql = "SELECT NOT \"REGEXP_LIKE\"('1', '^1$')\n" + "FROM (VALUES (0)) AS \"t\" (\"ZERO\")"; @@ -778,7 +778,7 @@ public void testRlikeTransformation() { @Test public void testRegexpTransformation() { - RelToTrinoConverter relToTrinoConverter = new RelToTrinoConverter(); + RelToTrinoConverter relToTrinoConverter = TestUtils.getRelToTrinoConverter(); RelNode relNode = TestUtils.getHiveToRelConverter().convertSql("SELECT '1' NOT REGEXP '^1$'"); String targetSql = "SELECT NOT \"REGEXP_LIKE\"('1', '^1$')\n" + "FROM (VALUES (0)) AS \"t\" (\"ZERO\")"; 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 4f2221a0d..2c6bb0f97 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 @@ -193,11 +193,11 @@ public static HiveToRelConverter getHiveToRelConverter() { } public static RelToTrinoConverter getRelToTrinoConverter() { - return new RelToTrinoConverter(); + return new RelToTrinoConverter(hiveMetastoreClient); } public static RelToTrinoConverter getRelToTrinoConverter(Map configs) { - return new RelToTrinoConverter(configs); + return new RelToTrinoConverter(hiveMetastoreClient, configs); } public static void initializeTablesAndViews(HiveConf conf) throws HiveException, MetaException, IOException { diff --git a/coral-trino/src/test/java/com/linkedin/coral/trino/trino2rel/ToRelTestUtils.java b/coral-trino/src/test/java/com/linkedin/coral/trino/trino2rel/ToRelTestUtils.java index 696f9d2b8..1c39ecfd4 100644 --- a/coral-trino/src/test/java/com/linkedin/coral/trino/trino2rel/ToRelTestUtils.java +++ b/coral-trino/src/test/java/com/linkedin/coral/trino/trino2rel/ToRelTestUtils.java @@ -48,7 +48,7 @@ public static TrinoToRelConverter getTrinoToRelConverter() { } public static RelToTrinoConverter getRelToTrinoConverter() { - return new RelToTrinoConverter(); + return new RelToTrinoConverter(hiveMetastoreClient); } public static void initializeViews(HiveConf conf) throws HiveException, MetaException, IOException { diff --git a/version.properties b/version.properties index 058fc8d52..e0da9119b 100644 --- a/version.properties +++ b/version.properties @@ -1,3 +1,3 @@ # Version of the produced binaries. # The version is inferred by shipkit-auto-version Gradle plugin (https://github.com/shipkit/shipkit-auto-version) -version=2.0.* \ No newline at end of file +version=2.1.* \ No newline at end of file