From 88f947dfe514851d656121fd17d035607eb7b214 Mon Sep 17 00:00:00 2001 From: wangzhiqiang Date: Mon, 28 Dec 2020 23:58:23 +0800 Subject: [PATCH] [fix] describe sometimes not work --- .../table/gateway/operation/DescribeTableOperation.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/ververica/flink/table/gateway/operation/DescribeTableOperation.java b/src/main/java/com/ververica/flink/table/gateway/operation/DescribeTableOperation.java index 39c6763..b155b2b 100644 --- a/src/main/java/com/ververica/flink/table/gateway/operation/DescribeTableOperation.java +++ b/src/main/java/com/ververica/flink/table/gateway/operation/DescribeTableOperation.java @@ -85,10 +85,10 @@ public ResultSet execute() { boolean isNullable = logicalType.isNullable(); String key = fieldToPrimaryKey.getOrDefault(column.getName(), null); - /** - * todo - */ - String computedColumn = ((TableColumn.ComputedColumn)column).getExpression(); + String computedColumn = null; + if (column instanceof TableColumn.ComputedColumn) { + computedColumn = ((TableColumn.ComputedColumn) column).getExpression(); + } String watermark = fieldToWatermark.getOrDefault(column.getName(), null); data.add(Row.of(name, type, isNullable, key, computedColumn, watermark));