Skip to content

Commit

Permalink
[Feature-1709][core] Support use FlinkSQL CTE to preview data
Browse files Browse the repository at this point in the history
  • Loading branch information
aiwenmo committed Nov 1, 2023
1 parent 523baf5 commit 8187465
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ static ResultBuilder build(
String timeZone) {
switch (operationType) {
case SELECT:
case WITH:
return new SelectResultBuilder(id, maxRowNum, isChangeLog, isAutoCancel, timeZone);
case SHOW:
case DESC:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ public JobParam pretreatStatements(String[] statements) {
statementList.add(statement);
} else if (operationType.equals(SqlType.INSERT)
|| operationType.equals(SqlType.SELECT)
|| operationType.equals(SqlType.WITH)
|| operationType.equals(SqlType.SHOW)
|| operationType.equals(SqlType.DESCRIBE)
|| operationType.equals(SqlType.DESC)
Expand Down
2 changes: 2 additions & 0 deletions dinky-executor/src/main/java/org/dinky/parser/SqlType.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ public enum SqlType {

CTAS("CTAS", "^CREATE\\s.*AS\\sSELECT.*$"),

WITH("WITH", "^WITH.*"),

UNKNOWN("UNKNOWN", "^UNKNOWN.*");

private String type;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const Result = (props: any) => {
id: current.id
});
const historyData = res.data;
if ('2' == historyData.status) {
if (historyData && '2' == historyData.status) {
const historyId = historyData.id;
const tableData = await handleGetOption('api/studio/getJobData', 'Get Data', {
jobId: historyId
Expand Down

0 comments on commit 8187465

Please sign in to comment.