Skip to content

Commit

Permalink
fix issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Samrat002 committed Aug 11, 2024
1 parent f2d5178 commit 457bf76
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -415,5 +416,4 @@ public static String getExpressionString(Expression expression, StringBuilder sb

return sb.toString();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
}
}

0 comments on commit 457bf76

Please sign in to comment.