Skip to content

Commit

Permalink
fix 1
Browse files Browse the repository at this point in the history
  • Loading branch information
liujiwen-up committed Jan 14, 2025
1 parent b71a792 commit de5650e
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,7 @@ public String getViewText() {
}

String originalText = getViewOriginalText();
String trinoViewSql = parseTrinoViewDefinition(originalText);
return trinoViewSql != null ? trinoViewSql : originalText;
return parseTrinoViewDefinition(originalText);
}

/**
Expand All @@ -481,11 +480,11 @@ public String getViewText() {
* }
*
* @param originalText The original view definition text
* @return The parsed SQL statement, or null if parsing fails
* @return The parsed SQL statement, or original text if parsing fails
*/
private String parseTrinoViewDefinition(String originalText) {
if (originalText == null || !originalText.contains("/* Presto View: ")) {
return null;
return originalText;
}

try {
Expand All @@ -503,7 +502,7 @@ private String parseTrinoViewDefinition(String originalText) {
} catch (Exception e) {
LOG.warn("Decoding Presto view definition failed", e);
}
return null;
return originalText;
}

public String getViewExpandedText() {
Expand Down

0 comments on commit de5650e

Please sign in to comment.