Unverified Commit 26ac55e2 authored by aiwenmo's avatar aiwenmo Committed by GitHub

[Feature-1709][core] Support use FlinkSQL CTE to preview data (#2482)

parent 523baf51
...@@ -39,6 +39,7 @@ public interface ResultBuilder { ...@@ -39,6 +39,7 @@ public interface ResultBuilder {
String timeZone) { String timeZone) {
switch (operationType) { switch (operationType) {
case SELECT: case SELECT:
case WITH:
return new SelectResultBuilder(id, maxRowNum, isChangeLog, isAutoCancel, timeZone); return new SelectResultBuilder(id, maxRowNum, isChangeLog, isAutoCancel, timeZone);
case SHOW: case SHOW:
case DESC: case DESC:
......
...@@ -126,6 +126,7 @@ public class Explainer { ...@@ -126,6 +126,7 @@ public class Explainer {
statementList.add(statement); statementList.add(statement);
} else if (operationType.equals(SqlType.INSERT) } else if (operationType.equals(SqlType.INSERT)
|| operationType.equals(SqlType.SELECT) || operationType.equals(SqlType.SELECT)
|| operationType.equals(SqlType.WITH)
|| operationType.equals(SqlType.SHOW) || operationType.equals(SqlType.SHOW)
|| operationType.equals(SqlType.DESCRIBE) || operationType.equals(SqlType.DESCRIBE)
|| operationType.equals(SqlType.DESC) || operationType.equals(SqlType.DESC)
......
...@@ -63,6 +63,8 @@ public enum SqlType { ...@@ -63,6 +63,8 @@ public enum SqlType {
CTAS("CTAS", "^CREATE\\s.*AS\\sSELECT.*$"), CTAS("CTAS", "^CREATE\\s.*AS\\sSELECT.*$"),
WITH("WITH", "^WITH.*"),
UNKNOWN("UNKNOWN", "^UNKNOWN.*"); UNKNOWN("UNKNOWN", "^UNKNOWN.*");
private String type; private String type;
......
...@@ -147,7 +147,7 @@ const Result = (props: any) => { ...@@ -147,7 +147,7 @@ const Result = (props: any) => {
id: current.id id: current.id
}); });
const historyData = res.data; const historyData = res.data;
if ('2' == historyData.status) { if (historyData && '2' == historyData.status) {
const historyId = historyData.id; const historyId = historyData.id;
const tableData = await handleGetOption('api/studio/getJobData', 'Get Data', { const tableData = await handleGetOption('api/studio/getJobData', 'Get Data', {
jobId: historyId jobId: historyId
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment