Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ private Serializable analyzeDescribeTable(HiveParserASTNode ast) throws Semantic
if (partSpec != null) {
handleUnsupportedOperation("DESCRIBE PARTITION is not supported");
}
if (colPath != null) {
if (!colPath.equals(tableName)) {
handleUnsupportedOperation("DESCRIBE COLUMNS is not supported");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@
import org.apache.flink.table.api.internal.TableEnvironmentInternal;
import org.apache.flink.table.catalog.CatalogPartitionSpec;
import org.apache.flink.table.catalog.CatalogTable;
import org.apache.flink.table.catalog.ObjectIdentifier;
import org.apache.flink.table.catalog.ObjectPath;
import org.apache.flink.table.catalog.hive.HiveCatalog;
import org.apache.flink.table.catalog.hive.HiveTestUtils;
import org.apache.flink.table.delegation.Parser;
import org.apache.flink.table.operations.DescribeTableOperation;
import org.apache.flink.table.operations.command.ClearOperation;
import org.apache.flink.table.operations.command.HelpOperation;
import org.apache.flink.table.operations.command.QuitOperation;
Expand Down Expand Up @@ -255,6 +257,27 @@ public void testCreateTable() throws Exception {
tableEnv.executeSql("create table if not exists tbl5 (m map<bigint,string>)");
hiveTable = hiveCatalog.getHiveTable(new ObjectPath("default", "tbl5"));
assertEquals(createdTimeForTableExists, hiveTable.getCreateTime());

// test describe table
Parser parser = ((TableEnvironmentInternal) tableEnv).getParser();
DescribeTableOperation operation =
(DescribeTableOperation) parser.parse("desc tbl1").get(0);
assertFalse(operation.isExtended());
assertEquals(
ObjectIdentifier.of(hiveCatalog.getName(), "default", "tbl1"),
operation.getSqlIdentifier());

operation = (DescribeTableOperation) parser.parse("describe default.tbl2").get(0);
assertFalse(operation.isExtended());
assertEquals(
ObjectIdentifier.of(hiveCatalog.getName(), "default", "tbl2"),
operation.getSqlIdentifier());

operation = (DescribeTableOperation) parser.parse("describe extended tbl3").get(0);
assertTrue(operation.isExtended());
assertEquals(
ObjectIdentifier.of(hiveCatalog.getName(), "default", "tbl3"),
operation.getSqlIdentifier());
}

@Test
Expand Down