From 6ee17a544b3dac9457421cc318b5034c7b8fc787 Mon Sep 17 00:00:00 2001 From: Yuya Ebihara Date: Mon, 1 Apr 2024 14:13:33 +0900 Subject: [PATCH] Remove unused HiveToTrinoConverter --- .../trino/rel2trino/HiveToTrinoConverter.java | 64 ------------------- 1 file changed, 64 deletions(-) delete mode 100644 coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/HiveToTrinoConverter.java 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 deleted file mode 100644 index 30e637ab2..000000000 --- a/coral-trino/src/main/java/com/linkedin/coral/trino/rel2trino/HiveToTrinoConverter.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Copyright 2017-2023 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 java.util.Map; - -import org.apache.calcite.rel.RelNode; - -import com.linkedin.coral.common.HiveMetastoreClient; -import com.linkedin.coral.hive.hive2rel.HiveToRelConverter; - -import static com.google.common.base.Preconditions.*; - - -public class HiveToTrinoConverter { - - private final HiveToRelConverter hiveToRelConverter; - private final RelToTrinoConverter relToTrinoConverter; - - public static HiveToTrinoConverter create(HiveMetastoreClient mscClient) { - checkNotNull(mscClient); - HiveToRelConverter hiveToRelConverter = new HiveToRelConverter(mscClient); - RelToTrinoConverter relToTrinoConverter = new RelToTrinoConverter(mscClient); - return new HiveToTrinoConverter(hiveToRelConverter, relToTrinoConverter); - } - - public static HiveToTrinoConverter create(HiveMetastoreClient mscClient, Map configs) { - checkNotNull(mscClient); - checkNotNull(configs); - HiveToRelConverter hiveToRelConverter = new HiveToRelConverter(mscClient); - RelToTrinoConverter relToTrinoConverter = new RelToTrinoConverter(mscClient, configs); - return new HiveToTrinoConverter(hiveToRelConverter, relToTrinoConverter); - } - - private HiveToTrinoConverter(HiveToRelConverter hiveToRelConverter, RelToTrinoConverter relToTrinoConverter) { - this.hiveToRelConverter = hiveToRelConverter; - this.relToTrinoConverter = relToTrinoConverter; - } - - /** - * Converts input HiveQL to Trino's SQL - * - * @param hiveSql hive sql query string - * @return Trino-compatible SQL string representing input hiveSql - */ - public String toTrinoSql(String hiveSql) { - RelNode rel = hiveToRelConverter.convertSql(hiveSql); - return relToTrinoConverter.convert(rel); - } - - /** - * Converts input view definition to Trino SQL - * @param dbName hive DB name - * @param viewName hive view base name - * @return Trino-compatible SQL matching input view definition - */ - public String toTrinoSql(String dbName, String viewName) { - RelNode rel = hiveToRelConverter.convertView(dbName, viewName); - return relToTrinoConverter.convert(rel); - } -}