From 457bf76135d8f92b8aa2773a4ae2037c3f06111d Mon Sep 17 00:00:00 2001 From: Samrat002 Date: Sun, 11 Aug 2024 11:03:34 +0530 Subject: [PATCH] fix issue --- .../table/catalog/glue/util/GlueUtils.java | 30 +++++++++---------- .../catalog/glue/util/GlueUtilsTest.java | 4 +-- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/flink-catalog-aws/flink-catalog-aws-glue/src/main/java/org/apache/flink/table/catalog/glue/util/GlueUtils.java b/flink-catalog-aws/flink-catalog-aws-glue/src/main/java/org/apache/flink/table/catalog/glue/util/GlueUtils.java index dc1fa9b9..f265e4d0 100644 --- a/flink-catalog-aws/flink-catalog-aws-glue/src/main/java/org/apache/flink/table/catalog/glue/util/GlueUtils.java +++ b/flink-catalog-aws/flink-catalog-aws-glue/src/main/java/org/apache/flink/table/catalog/glue/util/GlueUtils.java @@ -382,20 +382,21 @@ public static String getGlueFunctionClassName(CatalogFunction function) { * @param sb StringBuilder. * @return Derived String from {@link Expression}. */ -// public static String getExpressionString(Expression expression, StringBuilder sb) { -// -// for (Expression childExpression : expression.getChildren()) { -// if (childExpression.getChildren() != null && !childExpression.getChildren().isEmpty()) { -// getExpressionString(childExpression, sb); -// } -// } -// return sb.insert( -// 0, -// expression.asSummaryString() -// + GlueCatalogConstants.SPACE -// + GlueCatalogConstants.AND) -// .toString(); -// } + // public static String getExpressionString(Expression expression, StringBuilder sb) { + // + // for (Expression childExpression : expression.getChildren()) { + // if (childExpression.getChildren() != null && + // !childExpression.getChildren().isEmpty()) { + // getExpressionString(childExpression, sb); + // } + // } + // return sb.insert( + // 0, + // expression.asSummaryString() + // + GlueCatalogConstants.SPACE + // + GlueCatalogConstants.AND) + // .toString(); + // } public static String getExpressionString(Expression expression, StringBuilder sb) { for (Expression childExpression : expression.getChildren()) { if (childExpression.getChildren() != null && !childExpression.getChildren().isEmpty()) { @@ -415,5 +416,4 @@ public static String getExpressionString(Expression expression, StringBuilder sb return sb.toString(); } - } diff --git a/flink-catalog-aws/flink-catalog-aws-glue/src/test/java/org/apache/flink/table/catalog/glue/util/GlueUtilsTest.java b/flink-catalog-aws/flink-catalog-aws-glue/src/test/java/org/apache/flink/table/catalog/glue/util/GlueUtilsTest.java index 99f2355c..671500a5 100644 --- a/flink-catalog-aws/flink-catalog-aws-glue/src/test/java/org/apache/flink/table/catalog/glue/util/GlueUtilsTest.java +++ b/flink-catalog-aws/flink-catalog-aws-glue/src/test/java/org/apache/flink/table/catalog/glue/util/GlueUtilsTest.java @@ -25,9 +25,9 @@ import org.apache.flink.table.catalog.ObjectPath; import org.apache.flink.table.catalog.exceptions.CatalogException; import org.apache.flink.table.catalog.glue.constants.GlueCatalogConstants; - import org.apache.flink.table.expressions.Expression; import org.apache.flink.table.expressions.utils.ResolvedExpressionMock; + import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import software.amazon.awssdk.services.glue.model.Database; @@ -172,6 +172,6 @@ public void testExpressionString() { StringBuilder sb = new StringBuilder(); Expression expression = ResolvedExpressionMock.of(DataTypes.INT(), "column1"); GlueUtils.getExpressionString(expression, sb); - Assertions.assertEquals( "column1", sb.toString()); + Assertions.assertEquals("column1", sb.toString()); } }