You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@paimon.apache.org by ni...@apache.org on 2024/07/12 07:15:14 UTC
(paimon-webui) branch branch-0.1 updated (1d5e94df -> eae5f5d8)
This is an automated email from the ASF dual-hosted git repository.
nicholasjiang pushed a change to branch branch-0.1
in repository https://gitbox.apache.org/repos/asf/paimon-webui.git
from 1d5e94df [Bugfix] Fix CI (#494)
new e55b3fb4 [Improvement] Unify global date format (#496)
new ed42b198 [Bugfix] Fix prompt language when deleting users (#500)
new e5d072df [Bugfix] Fix adding user failure (#498)
new 192effa1 [Improvement] Support query limit (#502)
new 5efcadc6 [Bugfix] Fix missing create time and update time for editing table data (#506)
new 10f47a2a [Bugfix] Fix deploymentMode can not render correct for editing cluster (#508)
new eae5f5d8 [Feature] Frontend supports query limit (#510)
The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../web/engine/flink/common/executor/Executor.java | 3 +-
.../flink/common/parser/CustomSqlParser.java | 86 ++++++++++++
.../flink/common/parser/CustomSqlParserTest.java | 54 ++++++++
.../flink/common/parser}/StatementsConstant.java | 51 ++++++-
.../gateway/executor/FlinkSqlGatewayExecutor.java | 24 ++--
.../executor/FlinkSqlGatewayExecutorTest.java | 21 +--
paimon-web-engine/paimon-web-engine-flink/pom.xml | 1 -
paimon-web-server/pom.xml | 7 -
.../server/configrue/GlobalExceptionHandler.java | 2 +-
.../paimon/web/server/configrue/JacksonConfig.java | 27 +++-
.../paimon/web/server/data/dto/JobSubmitDTO.java | 2 +
.../apache/paimon/web/server/data/model/User.java | 4 -
.../web/server/service/impl/JobServiceImpl.java | 5 +-
.../src/main/resources/mapper/UserMapper.xml | 41 +++---
.../web/server/configurer/JacksonConfigTests.java | 73 ++++++++++-
.../web/server/controller/UserControllerTest.java | 3 -
paimon-web-ui/src/api/models/job/types/job.ts | 1 +
paimon-web-ui/src/locales/en/modules/playground.ts | 4 +
paimon-web-ui/src/locales/zh/modules/playground.ts | 4 +
.../query/components/debugger/index.module.scss | 14 +-
.../components/query/components/debugger/index.tsx | 146 +++++++++++----------
.../query/components/tabs/index.module.scss | 1 -
.../cluster/components/cluster-form/index.tsx | 2 +-
paimon-web-ui/src/views/system/cluster/index.tsx | 3 -
paimon-web-ui/src/views/system/user/index.tsx | 4 -
scripts/sql/paimon-mysql.sql | 1 -
26 files changed, 421 insertions(+), 163 deletions(-)
create mode 100644 paimon-web-engine/paimon-web-engine-flink/paimon-web-engine-flink-common/src/main/java/org/apache/paimon/web/engine/flink/common/parser/CustomSqlParser.java
create mode 100644 paimon-web-engine/paimon-web-engine-flink/paimon-web-engine-flink-common/src/test/java/org/apache/paimon/web/engine/flink/common/parser/CustomSqlParserTest.java
copy {paimon-web-server/src/test/java/org/apache/paimon/web/server/constant => paimon-web-engine/paimon-web-engine-flink/paimon-web-engine-flink-common/src/test/java/org/apache/paimon/web/engine/flink/common/parser}/StatementsConstant.java (59%)
(paimon-webui) 05/07: [Bugfix] Fix missing create time and update time for editing table data (#506)
Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
nicholasjiang pushed a commit to branch branch-0.1
in repository https://gitbox.apache.org/repos/asf/paimon-webui.git
commit 5efcadc6f51c799bb2811b3f5967f4ca3a617040
Author: yangyang zhong <35...@users.noreply.github.com>
AuthorDate: Thu Jul 11 23:03:28 2024 +0800
[Bugfix] Fix missing create time and update time for editing table data (#506)
---
paimon-web-ui/src/views/system/cluster/index.tsx | 3 ---
paimon-web-ui/src/views/system/user/index.tsx | 4 ----
2 files changed, 7 deletions(-)
diff --git a/paimon-web-ui/src/views/system/cluster/index.tsx b/paimon-web-ui/src/views/system/cluster/index.tsx
index ff2862d4..bec220cd 100644
--- a/paimon-web-ui/src/views/system/cluster/index.tsx
+++ b/paimon-web-ui/src/views/system/cluster/index.tsx
@@ -157,9 +157,6 @@ export default defineComponent({
async function handleUpdateModal(cluster: ClusterDTO) {
formType.value = 'update'
- delete cluster.createTime
- delete cluster.updateTime
-
formValue.value = { ...cluster }
formVisible.value = true
}
diff --git a/paimon-web-ui/src/views/system/user/index.tsx b/paimon-web-ui/src/views/system/user/index.tsx
index 5d1f6004..d9c1fd78 100644
--- a/paimon-web-ui/src/views/system/user/index.tsx
+++ b/paimon-web-ui/src/views/system/user/index.tsx
@@ -116,10 +116,6 @@ export default defineComponent({
async function handleUpdateModal(user: UserDTO) {
formType.value = 'update'
- delete user.createTime
- delete user.updateTime
- delete user.roles
-
formValue.value = { ...user }
formVisible.value = true
}
(paimon-webui) 04/07: [Improvement] Support query limit (#502)
Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
nicholasjiang pushed a commit to branch branch-0.1
in repository https://gitbox.apache.org/repos/asf/paimon-webui.git
commit 192effa147a734169cf7d0fd17d11fb552184ee8
Author: s7monk <34...@users.noreply.github.com>
AuthorDate: Thu Jul 11 16:43:13 2024 +0800
[Improvement] Support query limit (#502)
---
.../web/engine/flink/common/executor/Executor.java | 3 +-
.../flink/common/parser/CustomSqlParser.java | 86 +++++++++++++++
.../flink/common/parser/CustomSqlParserTest.java | 54 ++++++++++
.../flink/common/parser/StatementsConstant.java | 117 +++++++++++++++++++++
.../gateway/executor/FlinkSqlGatewayExecutor.java | 24 +++--
.../executor/FlinkSqlGatewayExecutorTest.java | 21 ++--
paimon-web-engine/paimon-web-engine-flink/pom.xml | 1 -
paimon-web-server/pom.xml | 7 --
.../paimon/web/server/data/dto/JobSubmitDTO.java | 2 +
.../web/server/service/impl/JobServiceImpl.java | 5 +-
10 files changed, 291 insertions(+), 29 deletions(-)
diff --git a/paimon-web-engine/paimon-web-engine-flink/paimon-web-engine-flink-common/src/main/java/org/apache/paimon/web/engine/flink/common/executor/Executor.java b/paimon-web-engine/paimon-web-engine-flink/paimon-web-engine-flink-common/src/main/java/org/apache/paimon/web/engine/flink/common/executor/Executor.java
index 60a754f6..f3e8bece 100644
--- a/paimon-web-engine/paimon-web-engine-flink/paimon-web-engine-flink-common/src/main/java/org/apache/paimon/web/engine/flink/common/executor/Executor.java
+++ b/paimon-web-engine/paimon-web-engine-flink/paimon-web-engine-flink-common/src/main/java/org/apache/paimon/web/engine/flink/common/executor/Executor.java
@@ -31,10 +31,11 @@ public interface Executor {
* Executes an SQL statement.
*
* @param statement The SQL statement to be executed.
+ * @param maxRows The maximum number of rows to return in the result set.
* @return SubmitResult containing information about the execution result.
* @throws Exception if there is an error executing the SQL statement.
*/
- ExecutionResult executeSql(String statement) throws Exception;
+ ExecutionResult executeSql(String statement, int maxRows) throws Exception;
/**
* Fetches the results of a previously submitted SQL statement execution.
diff --git a/paimon-web-engine/paimon-web-engine-flink/paimon-web-engine-flink-common/src/main/java/org/apache/paimon/web/engine/flink/common/parser/CustomSqlParser.java b/paimon-web-engine/paimon-web-engine-flink/paimon-web-engine-flink-common/src/main/java/org/apache/paimon/web/engine/flink/common/parser/CustomSqlParser.java
new file mode 100644
index 00000000..395a7efc
--- /dev/null
+++ b/paimon-web-engine/paimon-web-engine-flink/paimon-web-engine-flink-common/src/main/java/org/apache/paimon/web/engine/flink/common/parser/CustomSqlParser.java
@@ -0,0 +1,86 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.web.engine.flink.common.parser;
+
+import org.apache.calcite.config.Lex;
+import org.apache.calcite.sql.SqlIdentifier;
+import org.apache.calcite.sql.SqlLiteral;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.SqlNodeList;
+import org.apache.calcite.sql.SqlSelect;
+import org.apache.calcite.sql.parser.SqlParseException;
+import org.apache.calcite.sql.parser.SqlParser;
+import org.apache.calcite.sql.parser.SqlParserPos;
+import org.apache.flink.sql.parser.impl.FlinkSqlParserImpl;
+import org.apache.flink.sql.parser.validate.FlinkSqlConformance;
+
+/** CustomSqlParser to parse Sql list. */
+public class CustomSqlParser {
+
+ private static final SqlParser.Config config;
+ private final SqlParser parser;
+ private final int limit;
+
+ static {
+ config =
+ SqlParser.config()
+ .withParserFactory(FlinkSqlParserImpl.FACTORY)
+ .withConformance(FlinkSqlConformance.DEFAULT)
+ .withLex(Lex.JAVA)
+ .withIdentifierMaxLength(256);
+ }
+
+ public CustomSqlParser(String sql, int limit) {
+ this.parser = SqlParser.create(sql, config);
+ this.limit = limit;
+ }
+
+ public SqlNodeList parseStmtList() throws SqlParseException {
+ SqlNodeList nodeList = parser.parseStmtList();
+ for (SqlNode node : nodeList) {
+ if (node instanceof SqlSelect) {
+ SqlSelect select = (SqlSelect) node;
+ if (!hasAggregateOrGroupBy(select) && select.getFetch() == null) {
+ SqlLiteral sqlLiteral =
+ SqlLiteral.createExactNumeric(String.valueOf(limit), SqlParserPos.ZERO);
+ select.setFetch(sqlLiteral);
+ }
+ }
+ }
+ return nodeList;
+ }
+
+ private boolean hasAggregateOrGroupBy(SqlSelect select) {
+ if (select.getGroup() != null && !select.getGroup().isEmpty()) {
+ return true;
+ }
+ return containsComplexOperations(select.getSelectList());
+ }
+
+ private boolean containsComplexOperations(SqlNodeList nodes) {
+ if (nodes != null) {
+ for (SqlNode node : nodes) {
+ if (!(node instanceof SqlIdentifier)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+}
diff --git a/paimon-web-engine/paimon-web-engine-flink/paimon-web-engine-flink-common/src/test/java/org/apache/paimon/web/engine/flink/common/parser/CustomSqlParserTest.java b/paimon-web-engine/paimon-web-engine-flink/paimon-web-engine-flink-common/src/test/java/org/apache/paimon/web/engine/flink/common/parser/CustomSqlParserTest.java
new file mode 100644
index 00000000..967c73a2
--- /dev/null
+++ b/paimon-web-engine/paimon-web-engine-flink/paimon-web-engine-flink-common/src/test/java/org/apache/paimon/web/engine/flink/common/parser/CustomSqlParserTest.java
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.web.engine.flink.common.parser;
+
+import org.apache.calcite.sql.SqlNodeList;
+import org.apache.calcite.sql.parser.SqlParseException;
+import org.junit.jupiter.api.Test;
+
+import static org.apache.paimon.web.engine.flink.common.parser.StatementsConstant.statement1;
+import static org.apache.paimon.web.engine.flink.common.parser.StatementsConstant.statement2;
+import static org.apache.paimon.web.engine.flink.common.parser.StatementsConstant.statement3;
+import static org.assertj.core.api.Assertions.assertThat;
+
+/** Tests of {@link CustomSqlParser}. */
+public class CustomSqlParserTest {
+
+ @Test
+ public void testParse() throws SqlParseException {
+ CustomSqlParser customSqlParser = new CustomSqlParser(statement1, 0);
+ SqlNodeList sqlNodeList = customSqlParser.parseStmtList();
+ assertThat(sqlNodeList.size()).isEqualTo(5);
+ }
+
+ @Test
+ public void testSelectLimit() throws SqlParseException {
+ CustomSqlParser customSqlParser = new CustomSqlParser(statement2, 500);
+ String actual = customSqlParser.parseStmtList().get(2).toString();
+ assertThat(actual)
+ .isEqualToIgnoringWhitespace("SELECT * FROM `t_order` FETCH NEXT 500 ROWS ONLY");
+ }
+
+ @Test
+ public void testSelectWithoutLimit() throws SqlParseException {
+ CustomSqlParser customSqlParser = new CustomSqlParser(statement3, 200);
+ String actual = customSqlParser.parseStmtList().get(2).toString();
+ assertThat(actual).isEqualToIgnoringWhitespace("SELECT COUNT(*) FROM `t_order`");
+ }
+}
diff --git a/paimon-web-engine/paimon-web-engine-flink/paimon-web-engine-flink-common/src/test/java/org/apache/paimon/web/engine/flink/common/parser/StatementsConstant.java b/paimon-web-engine/paimon-web-engine-flink/paimon-web-engine-flink-common/src/test/java/org/apache/paimon/web/engine/flink/common/parser/StatementsConstant.java
new file mode 100644
index 00000000..e029c4ba
--- /dev/null
+++ b/paimon-web-engine/paimon-web-engine-flink/paimon-web-engine-flink-common/src/test/java/org/apache/paimon/web/engine/flink/common/parser/StatementsConstant.java
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.web.engine.flink.common.parser;
+
+/** Statements constant. */
+public class StatementsConstant {
+
+ public static String statement1 =
+ "DROP TABLE IF EXISTS t_order;\n"
+ + "CREATE TABLE IF NOT EXISTS t_order(\n"
+ + " --order id\n"
+ + " `order_id` BIGINT,\n"
+ + " --product\n"
+ + " `product` BIGINT,\n"
+ + " --amount\n"
+ + " `amount` BIGINT,\n"
+ + " --payment time\n"
+ + " `order_time` as CAST(CURRENT_TIMESTAMP AS TIMESTAMP(3)),\n"
+ + " --WATERMARK\n"
+ + " WATERMARK FOR order_time AS order_time-INTERVAL '2' SECOND\n"
+ + ") WITH(\n"
+ + " 'connector' = 'datagen',\n"
+ + " 'rows-per-second' = '1',\n"
+ + " 'fields.order_id.min' = '1',\n"
+ + " 'fields.order_id.max' = '2',\n"
+ + " 'fields.amount.min' = '1',\n"
+ + " 'fields.amount.max' = '10',\n"
+ + " 'fields.product.min' = '1',\n"
+ + " 'fields.product.max' = '2'\n"
+ + ");\n"
+ + "-- SELECT * FROM t_order LIMIT 10;\n"
+ + "DROP TABLE IF EXISTS sink_table;\n"
+ + "CREATE TABLE IF NOT EXISTS sink_table(\n"
+ + " --product\n"
+ + " `product` BIGINT,\n"
+ + " --amount\n"
+ + " `amount` BIGINT,\n"
+ + " --payment time\n"
+ + " `order_time` TIMESTAMP(3),\n"
+ + " `one_minute_sum` BIGINT\n"
+ + ") WITH('connector' = 'print');\n"
+ + "\n"
+ + "INSERT INTO\n"
+ + " sink_table\n"
+ + "SELECT\n"
+ + " product,\n"
+ + " amount,\n"
+ + " order_time,\n"
+ + " 0 as one_minute_sum\n"
+ + "FROM\n"
+ + " t_order;";
+
+ public static String statement2 =
+ "DROP TABLE IF EXISTS t_order;\n"
+ + "CREATE TABLE IF NOT EXISTS t_order(\n"
+ + " --order id\n"
+ + " `order_id` BIGINT,\n"
+ + " --product\n"
+ + " `product` BIGINT,\n"
+ + " --amount\n"
+ + " `amount` BIGINT,\n"
+ + " --payment time\n"
+ + " `order_time` as CAST(CURRENT_TIMESTAMP AS TIMESTAMP(3)),\n"
+ + " --WATERMARK\n"
+ + " WATERMARK FOR order_time AS order_time-INTERVAL '2' SECOND\n"
+ + ") WITH(\n"
+ + " 'connector' = 'datagen',\n"
+ + " 'rows-per-second' = '1',\n"
+ + " 'fields.order_id.min' = '1',\n"
+ + " 'fields.order_id.max' = '2',\n"
+ + " 'fields.amount.min' = '1',\n"
+ + " 'fields.amount.max' = '10',\n"
+ + " 'fields.product.min' = '1',\n"
+ + " 'fields.product.max' = '2'\n"
+ + ");\n"
+ + "SELECT * FROM t_order;";
+ public static String statement3 =
+ "DROP TABLE IF EXISTS t_order;\n"
+ + "CREATE TABLE IF NOT EXISTS t_order(\n"
+ + " --order id\n"
+ + " `order_id` BIGINT,\n"
+ + " --product\n"
+ + " `product` BIGINT,\n"
+ + " --amount\n"
+ + " `amount` BIGINT,\n"
+ + " --payment time\n"
+ + " `order_time` as CAST(CURRENT_TIMESTAMP AS TIMESTAMP(3)),\n"
+ + " --WATERMARK\n"
+ + " WATERMARK FOR order_time AS order_time-INTERVAL '2' SECOND\n"
+ + ") WITH(\n"
+ + " 'connector' = 'datagen',\n"
+ + " 'rows-per-second' = '1',\n"
+ + " 'fields.order_id.min' = '1',\n"
+ + " 'fields.order_id.max' = '2',\n"
+ + " 'fields.amount.min' = '1',\n"
+ + " 'fields.amount.max' = '10',\n"
+ + " 'fields.product.min' = '1',\n"
+ + " 'fields.product.max' = '2'\n"
+ + ");\n"
+ + "SELECT count(*) FROM t_order;";
+}
diff --git a/paimon-web-engine/paimon-web-engine-flink/paimon-web-engine-flink-sql-gateway/src/main/java/org/apache/paimon/web/engine/flink/sql/gateway/executor/FlinkSqlGatewayExecutor.java b/paimon-web-engine/paimon-web-engine-flink/paimon-web-engine-flink-sql-gateway/src/main/java/org/apache/paimon/web/engine/flink/sql/gateway/executor/FlinkSqlGatewayExecutor.java
index 12c5b4de..ab58e471 100644
--- a/paimon-web-engine/paimon-web-engine-flink/paimon-web-engine-flink-sql-gateway/src/main/java/org/apache/paimon/web/engine/flink/sql/gateway/executor/FlinkSqlGatewayExecutor.java
+++ b/paimon-web-engine/paimon-web-engine-flink/paimon-web-engine-flink-sql-gateway/src/main/java/org/apache/paimon/web/engine/flink/sql/gateway/executor/FlinkSqlGatewayExecutor.java
@@ -20,7 +20,7 @@ package org.apache.paimon.web.engine.flink.sql.gateway.executor;
import org.apache.paimon.web.engine.flink.common.executor.Executor;
import org.apache.paimon.web.engine.flink.common.operation.FlinkSqlOperationType;
-import org.apache.paimon.web.engine.flink.common.parser.StatementParser;
+import org.apache.paimon.web.engine.flink.common.parser.CustomSqlParser;
import org.apache.paimon.web.engine.flink.common.result.ExecutionResult;
import org.apache.paimon.web.engine.flink.common.result.FetchResultParams;
import org.apache.paimon.web.engine.flink.sql.gateway.client.SqlGatewayClient;
@@ -28,6 +28,8 @@ import org.apache.paimon.web.engine.flink.sql.gateway.model.SessionEntity;
import org.apache.paimon.web.engine.flink.sql.gateway.utils.CollectResultUtil;
import org.apache.paimon.web.engine.flink.sql.gateway.utils.FlinkSqlStatementSetBuilder;
+import org.apache.calcite.sql.SqlNode;
+import org.apache.calcite.sql.SqlNodeList;
import org.apache.flink.table.gateway.api.results.ResultSet;
import org.apache.flink.table.gateway.rest.message.statement.FetchResultsResponseBody;
@@ -53,16 +55,18 @@ public class FlinkSqlGatewayExecutor implements Executor {
}
@Override
- public ExecutionResult executeSql(String multiStatement) throws Exception {
- String[] statements = StatementParser.parse(multiStatement);
+ public ExecutionResult executeSql(String multiStatement, int maxRows) throws Exception {
+ CustomSqlParser customSqlParser = new CustomSqlParser(multiStatement, maxRows);
+ SqlNodeList sqlNodeList = customSqlParser.parseStmtList();
List<String> insertStatements = new ArrayList<>();
ExecutionResult executionResult = null;
- for (String statement : statements) {
- FlinkSqlOperationType operationType = FlinkSqlOperationType.getOperationType(statement);
+ for (SqlNode sqlNode : sqlNodeList) {
+ FlinkSqlOperationType operationType =
+ FlinkSqlOperationType.getOperationType(sqlNode.toString());
if (operationType == null) {
- String operationTypeString = extractSqlOperationType(statement);
+ String operationTypeString = extractSqlOperationType(sqlNode.toString());
throw new UnsupportedOperationException(
"Unsupported operation type: " + operationTypeString);
}
@@ -73,17 +77,17 @@ public class FlinkSqlGatewayExecutor implements Executor {
throw new UnsupportedOperationException(
"Cannot execute DQL statement with pending INSERT statements.");
}
- executionResult = executeDqlStatement(statement, operationType);
+ executionResult = executeDqlStatement(sqlNode.toString(), operationType);
break;
case DML:
if (operationType.getType().equals(FlinkSqlOperationType.INSERT.getType())) {
- insertStatements.add(statement);
+ insertStatements.add(sqlNode.toString());
} else {
- executionResult = executeDmlStatement(statement);
+ executionResult = executeDmlStatement(sqlNode.toString());
}
break;
default:
- client.executeStatement(session.getSessionId(), statement, null);
+ client.executeStatement(session.getSessionId(), sqlNode.toString(), null);
break;
}
diff --git a/paimon-web-engine/paimon-web-engine-flink/paimon-web-engine-flink-sql-gateway/src/test/java/org/apache/paimon/web/engine/flink/sql/gataway/executor/FlinkSqlGatewayExecutorTest.java b/paimon-web-engine/paimon-web-engine-flink/paimon-web-engine-flink-sql-gateway/src/test/java/org/apache/paimon/web/engine/flink/sql/gataway/executor/FlinkSqlGatewayExecutorTest.java
index 42620af7..69a6d8a8 100644
--- a/paimon-web-engine/paimon-web-engine-flink/paimon-web-engine-flink-sql-gateway/src/test/java/org/apache/paimon/web/engine/flink/sql/gataway/executor/FlinkSqlGatewayExecutorTest.java
+++ b/paimon-web-engine/paimon-web-engine-flink/paimon-web-engine-flink-sql-gateway/src/test/java/org/apache/paimon/web/engine/flink/sql/gataway/executor/FlinkSqlGatewayExecutorTest.java
@@ -25,6 +25,7 @@ import org.apache.paimon.web.engine.flink.sql.gateway.client.SqlGatewayClient;
import org.apache.paimon.web.engine.flink.sql.gateway.executor.FlinkSqlGatewayExecutor;
import org.apache.paimon.web.engine.flink.sql.gateway.model.SessionEntity;
+import org.apache.calcite.sql.parser.SqlParseException;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -52,21 +53,23 @@ public class FlinkSqlGatewayExecutorTest extends TestBase {
@Test
public void testExecuteSql() throws Exception {
- ExecutionResult executionResult = executor.executeSql(StatementsConstant.statement);
+ ExecutionResult executionResult = executor.executeSql(StatementsConstant.statement, 0);
assertNotNull(executionResult);
assertNotNull(executionResult.getJobId());
}
@Test
public void testExecuteStatementSetSql() throws Exception {
- ExecutionResult executionResult = executor.executeSql(StatementsConstant.statementSetSql);
+ ExecutionResult executionResult =
+ executor.executeSql(StatementsConstant.statementSetSql, 0);
assertNotNull(executionResult);
assertNotNull(executionResult.getJobId());
}
@Test
public void testExecutorStatementWithoutResult() throws Exception {
- ExecutionResult executionResult = executor.executeSql(StatementsConstant.createStatement);
+ ExecutionResult executionResult =
+ executor.executeSql(StatementsConstant.createStatement, 0);
assertNull(executionResult);
}
@@ -77,7 +80,8 @@ public class FlinkSqlGatewayExecutorTest extends TestBase {
UnsupportedOperationException.class,
() -> {
executor.executeSql(
- StatementsConstant.selectStatementWithPendingInsertStatements);
+ StatementsConstant.selectStatementWithPendingInsertStatements,
+ 0);
});
String expectedMessage = "Cannot execute DQL statement with pending INSERT statements.";
String actualMessage = exception.getMessage();
@@ -88,18 +92,19 @@ public class FlinkSqlGatewayExecutorTest extends TestBase {
public void testExecuteBadSqlStatement() {
Exception exception =
assertThrows(
- UnsupportedOperationException.class,
+ SqlParseException.class,
() -> {
- executor.executeSql(StatementsConstant.badStatement);
+ executor.executeSql(StatementsConstant.badStatement, 0);
});
- String expectedMessage = "Unsupported operation type: CREAT";
+ String expectedMessage = "Non-query expression encountered in illegal context";
String actualMessage = exception.getMessage();
assertTrue(actualMessage.contains(expectedMessage));
}
@Test
public void testFetchResults() throws Exception {
- ExecutionResult executionResult = executor.executeSql(StatementsConstant.selectStatement);
+ ExecutionResult executionResult =
+ executor.executeSql(StatementsConstant.selectStatement, 10);
assertNotNull(executionResult);
assertNotNull(executionResult.getJobId());
assertNotNull(executionResult.getSubmitId());
diff --git a/paimon-web-engine/paimon-web-engine-flink/pom.xml b/paimon-web-engine/paimon-web-engine-flink/pom.xml
index 476a6bc2..1db29878 100644
--- a/paimon-web-engine/paimon-web-engine-flink/pom.xml
+++ b/paimon-web-engine/paimon-web-engine-flink/pom.xml
@@ -88,7 +88,6 @@ under the License.
<groupId>org.apache.flink</groupId>
<artifactId>flink-table-planner_${scala.version}</artifactId>
<version>${flink.version}</version>
- <scope>provided</scope>
</dependency>
<dependency>
diff --git a/paimon-web-server/pom.xml b/paimon-web-server/pom.xml
index 2d85244d..9bd9c433 100644
--- a/paimon-web-server/pom.xml
+++ b/paimon-web-server/pom.xml
@@ -248,13 +248,6 @@ under the License.
</exclusions>
</dependency>
- <dependency>
- <groupId>org.apache.flink</groupId>
- <artifactId>flink-table-planner_${scala.version}</artifactId>
- <version>${flink.version}</version>
- <scope>test</scope>
- </dependency>
-
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
diff --git a/paimon-web-server/src/main/java/org/apache/paimon/web/server/data/dto/JobSubmitDTO.java b/paimon-web-server/src/main/java/org/apache/paimon/web/server/data/dto/JobSubmitDTO.java
index 83e4c384..b3c4d6f7 100644
--- a/paimon-web-server/src/main/java/org/apache/paimon/web/server/data/dto/JobSubmitDTO.java
+++ b/paimon-web-server/src/main/java/org/apache/paimon/web/server/data/dto/JobSubmitDTO.java
@@ -39,4 +39,6 @@ public class JobSubmitDTO {
private Map<String, String> config;
private String statements;
+
+ private int maxRows;
}
diff --git a/paimon-web-server/src/main/java/org/apache/paimon/web/server/service/impl/JobServiceImpl.java b/paimon-web-server/src/main/java/org/apache/paimon/web/server/service/impl/JobServiceImpl.java
index ceb46c73..2df400e2 100644
--- a/paimon-web-server/src/main/java/org/apache/paimon/web/server/service/impl/JobServiceImpl.java
+++ b/paimon-web-server/src/main/java/org/apache/paimon/web/server/service/impl/JobServiceImpl.java
@@ -142,7 +142,8 @@ public class JobServiceImpl extends ServiceImpl<JobMapper, JobInfo> implements J
String.format(
"Starting to submit %s %s job...",
jobSubmitDTO.getTaskType(), executeMode));
- ExecutionResult executionResult = executor.executeSql(jobSubmitDTO.getStatements());
+ ExecutionResult executionResult =
+ executor.executeSql(jobSubmitDTO.getStatements(), jobSubmitDTO.getMaxRows());
if (StringUtils.isNotBlank(executionResult.getJobId())) {
JobInfo jobInfo = buildJobInfo(executionResult, jobSubmitDTO);
this.save(jobInfo);
@@ -318,7 +319,7 @@ public class JobServiceImpl extends ServiceImpl<JobMapper, JobInfo> implements J
return;
}
- ExecutionResult executionResult = executor.executeSql(SHOW_JOBS_STATEMENT);
+ ExecutionResult executionResult = executor.executeSql(SHOW_JOBS_STATEMENT, 0);
List<Map<String, Object>> jobsData = executionResult.getData();
for (Map<String, Object> jobData : jobsData) {
String jobId = (String) jobData.get("job id");
(paimon-webui) 03/07: [Bugfix] Fix adding user failure (#498)
Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
nicholasjiang pushed a commit to branch branch-0.1
in repository https://gitbox.apache.org/repos/asf/paimon-webui.git
commit e5d072dfd4fb3382f63bae0973292f77746e5090
Author: XianmingZhou00 <14...@users.noreply.github.com>
AuthorDate: Thu Jul 11 14:13:57 2024 +0800
[Bugfix] Fix adding user failure (#498)
---
.../apache/paimon/web/server/data/model/User.java | 4 ---
.../src/main/resources/mapper/UserMapper.xml | 41 +++++++++++-----------
.../web/server/controller/UserControllerTest.java | 3 --
scripts/sql/paimon-mysql.sql | 1 -
4 files changed, 21 insertions(+), 28 deletions(-)
diff --git a/paimon-web-server/src/main/java/org/apache/paimon/web/server/data/model/User.java b/paimon-web-server/src/main/java/org/apache/paimon/web/server/data/model/User.java
index 4ad8c1f3..b6ff5e76 100644
--- a/paimon-web-server/src/main/java/org/apache/paimon/web/server/data/model/User.java
+++ b/paimon-web-server/src/main/java/org/apache/paimon/web/server/data/model/User.java
@@ -23,7 +23,6 @@ import org.apache.paimon.web.server.data.enums.UserType;
import org.apache.paimon.web.server.validator.annotation.PhoneNumber;
import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -61,9 +60,6 @@ public class User extends BaseModel {
/** is enable. */
private Boolean enabled;
- /** is delete. */
- @TableLogic private Boolean isDelete;
-
/** avatar url. */
private String url;
diff --git a/paimon-web-server/src/main/resources/mapper/UserMapper.xml b/paimon-web-server/src/main/resources/mapper/UserMapper.xml
index d8d544a2..233fe251 100644
--- a/paimon-web-server/src/main/resources/mapper/UserMapper.xml
+++ b/paimon-web-server/src/main/resources/mapper/UserMapper.xml
@@ -62,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectUserVo">
- select u.id, u.username, u.nickname, u.user_type, u.email, u.url, u.mobile, u.password, u.is_delete, u.enabled, u.create_time,
+ select u.id, u.username, u.nickname, u.user_type, u.email, u.url, u.mobile, u.password, u.enabled, u.create_time,
u.update_time, r.id, r.role_name, r.role_key, r.sort, r.enabled as role_status
from user u
left join user_role urole on u.id = urole.user_id
@@ -71,25 +71,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="listUsers" parameterType="org.apache.paimon.web.server.data.model.User" resultMap="UserWithRolesResult">
<include refid="selectUserVo"/>
- where u.is_delete = '0'
- <if test="user.id != null and user.id != 0">
- AND u.id = #{user.id}
- </if>
- <if test="user.username != null and user.username != ''">
- AND u.username like concat('%', #{user.username}, '%')
- </if>
- <if test="user.enabled != null and user.enabled != ''">
- AND u.enabled = #{user.enabled}
- </if>
- <if test="user.mobile != null and user.mobile != ''">
- AND u.mobile like concat('%', #{user.mobile}, '%')
- </if>
- <if test="user.params.beginTime != null and user.params.beginTime != ''"><!-- Start time search -->
- AND date_format(u.create_time,'%y%m%d') >= date_format(#{user.params.beginTime},'%y%m%d')
- </if>
- <if test="user.params.endTime != null and user.params.endTime != ''"><!-- End time search -->
- AND date_format(u.create_time,'%y%m%d') <= date_format(#{user.params.endTime},'%y%m%d')
- </if>
+ <where>
+ <if test="user.id != null and user.id != 0">
+ AND u.id = #{user.id}
+ </if>
+ <if test="user.username != null and user.username != ''">
+ AND u.username like concat('%', #{user.username}, '%')
+ </if>
+ <if test="user.enabled != null and user.enabled != ''">
+ AND u.enabled = #{user.enabled}
+ </if>
+ <if test="user.mobile != null and user.mobile != ''">
+ AND u.mobile like concat('%', #{user.mobile}, '%')
+ </if>
+ <if test="user.params.beginTime != null and user.params.beginTime != ''"><!-- Start time search -->
+ AND date_format(u.create_time,'%y%m%d') >= date_format(#{user.params.beginTime},'%y%m%d')
+ </if>
+ <if test="user.params.endTime != null and user.params.endTime != ''"><!-- End time search -->
+ AND date_format(u.create_time,'%y%m%d') <= date_format(#{user.params.endTime},'%y%m%d')
+ </if>
+ </where>
</select>
<select id="selectAllocatedList" parameterType="org.apache.paimon.web.server.data.dto.RoleWithUserDTO" resultMap="SysUserResult">
diff --git a/paimon-web-server/src/test/java/org/apache/paimon/web/server/controller/UserControllerTest.java b/paimon-web-server/src/test/java/org/apache/paimon/web/server/controller/UserControllerTest.java
index 74d2aeb7..5c60fc08 100644
--- a/paimon-web-server/src/test/java/org/apache/paimon/web/server/controller/UserControllerTest.java
+++ b/paimon-web-server/src/test/java/org/apache/paimon/web/server/controller/UserControllerTest.java
@@ -73,7 +73,6 @@ public class UserControllerTest extends ControllerTestBase {
user.setPassword("test");
user.setUserType(UserType.LOCAL);
user.setEnabled(true);
- user.setIsDelete(false);
mockMvc.perform(
MockMvcRequestBuilders.post(userPath)
@@ -105,7 +104,6 @@ public class UserControllerTest extends ControllerTestBase {
user.setNickname(newUserName);
user.setUserType(UserType.LOCAL);
user.setEnabled(true);
- user.setIsDelete(false);
mockMvc.perform(
MockMvcRequestBuilders.put(userPath)
@@ -142,7 +140,6 @@ public class UserControllerTest extends ControllerTestBase {
user.setNickname(username);
user.setUserType(UserType.LOCAL);
user.setEnabled(true);
- user.setIsDelete(false);
user.setRoleIds(new Integer[] {2});
mockMvc.perform(
diff --git a/scripts/sql/paimon-mysql.sql b/scripts/sql/paimon-mysql.sql
index 83e4f9fc..ebf4f394 100644
--- a/scripts/sql/paimon-mysql.sql
+++ b/scripts/sql/paimon-mysql.sql
@@ -25,7 +25,6 @@ CREATE TABLE if not exists `user`
`mobile` varchar(20) NULL DEFAULT NULL COMMENT 'mobile phone',
`email` varchar(100) NULL DEFAULT NULL COMMENT 'email',
`enabled` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'is enable',
- `is_delete` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'is delete',
`create_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'create time',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'update time',
UNIQUE KEY `username` (`username`)
(paimon-webui) 01/07: [Improvement] Unify global date format (#496)
Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
nicholasjiang pushed a commit to branch branch-0.1
in repository https://gitbox.apache.org/repos/asf/paimon-webui.git
commit e55b3fb45b66c052a4046f8b185d45d01f52f7cd
Author: XianmingZhou00 <14...@users.noreply.github.com>
AuthorDate: Thu Jul 11 11:24:32 2024 +0800
[Improvement] Unify global date format (#496)
---
.../paimon/web/server/configrue/JacksonConfig.java | 27 +++++++-
.../web/server/configurer/JacksonConfigTests.java | 73 ++++++++++++++++++++--
2 files changed, 93 insertions(+), 7 deletions(-)
diff --git a/paimon-web-server/src/main/java/org/apache/paimon/web/server/configrue/JacksonConfig.java b/paimon-web-server/src/main/java/org/apache/paimon/web/server/configrue/JacksonConfig.java
index d2d8befb..a86038d8 100644
--- a/paimon-web-server/src/main/java/org/apache/paimon/web/server/configrue/JacksonConfig.java
+++ b/paimon-web-server/src/main/java/org/apache/paimon/web/server/configrue/JacksonConfig.java
@@ -24,17 +24,29 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
+import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
+import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer;
+import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
+import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
+import java.text.SimpleDateFormat;
+import java.time.LocalDate;
import java.time.LocalDateTime;
+import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
/** JacksonConfig. */
@Configuration
public class JacksonConfig {
+
+ public static final String DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
+ public static final String DATE_FORMAT = "yyyy-MM-dd";
+ public static final String TIME_FORMAT = "HH:mm:ss";
+
@Bean
public ObjectMapper getJacksonObjectMapper() {
ObjectMapper objectMapper = new ObjectMapper();
@@ -53,11 +65,22 @@ public class JacksonConfig {
JavaTimeModule javaTimeModule = new JavaTimeModule();
javaTimeModule.addSerializer(
LocalDateTime.class,
- new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+ new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(DATE_TIME_FORMAT)));
javaTimeModule.addDeserializer(
LocalDateTime.class,
- new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
+ new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern(DATE_TIME_FORMAT)));
+ javaTimeModule.addSerializer(
+ LocalDate.class, new LocalDateSerializer(DateTimeFormatter.ofPattern(DATE_FORMAT)));
+ javaTimeModule.addDeserializer(
+ LocalDate.class,
+ new LocalDateDeserializer(DateTimeFormatter.ofPattern(DATE_FORMAT)));
+ javaTimeModule.addSerializer(
+ LocalTime.class, new LocalTimeSerializer(DateTimeFormatter.ofPattern(TIME_FORMAT)));
+ javaTimeModule.addDeserializer(
+ LocalTime.class,
+ new LocalTimeDeserializer(DateTimeFormatter.ofPattern(TIME_FORMAT)));
objectMapper.registerModule(javaTimeModule);
+ objectMapper.setDateFormat(new SimpleDateFormat(DATE_TIME_FORMAT));
objectMapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY);
return objectMapper;
}
diff --git a/paimon-web-server/src/test/java/org/apache/paimon/web/server/configurer/JacksonConfigTests.java b/paimon-web-server/src/test/java/org/apache/paimon/web/server/configurer/JacksonConfigTests.java
index 4b27d882..4e1a675c 100644
--- a/paimon-web-server/src/test/java/org/apache/paimon/web/server/configurer/JacksonConfigTests.java
+++ b/paimon-web-server/src/test/java/org/apache/paimon/web/server/configurer/JacksonConfigTests.java
@@ -26,7 +26,14 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import java.io.IOException;
+import java.time.Instant;
+import java.time.LocalDate;
import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
+import java.util.Date;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
@@ -37,20 +44,24 @@ public class JacksonConfigTests {
@Autowired private ObjectMapper objectMapper;
- private static final String TIME_FORMATTED_JSON_STR = "\"2024-06-26 13:01:30\"";
- private static final String TIME_UNFORMATTED_JSON_STR = "\"2024-06-26T13:01:30Z\"";
+ private static final String DATE_TIME_FORMATTED_JSON_STR = "\"2024-06-26 13:01:30\"";
+ private static final String DATE_TIME_UNFORMATTED_JSON_STR = "\"2024-06-26T13:01:30Z\"";
+ private static final String DATE_FORMATTED_JSON_STR = "\"2024-06-26\"";
+ private static final String TIME_FORMATTED_JSON_STR = "\"13:01:30\"";
+ private static final String DATE_TIME_STR = "2024-06-26 13:01:30";
+ private static final String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss";
@Test
public void testLocalDateTimeSerialization() throws IOException {
LocalDateTime dateTime = LocalDateTime.of(2024, 6, 26, 13, 1, 30);
String json = objectMapper.writeValueAsString(dateTime);
- assertEquals(TIME_FORMATTED_JSON_STR, json);
+ assertEquals(DATE_TIME_FORMATTED_JSON_STR, json);
}
@Test
public void testLocalDateTimeDeserialization() throws IOException {
LocalDateTime dateTime =
- objectMapper.readValue(TIME_FORMATTED_JSON_STR, LocalDateTime.class);
+ objectMapper.readValue(DATE_TIME_FORMATTED_JSON_STR, LocalDateTime.class);
assertEquals(LocalDateTime.of(2024, 6, 26, 13, 1, 30), dateTime);
}
@@ -58,6 +69,58 @@ public class JacksonConfigTests {
public void testInvalidLocalDateTimeDeserialization() {
assertThrows(
com.fasterxml.jackson.databind.exc.InvalidFormatException.class,
- () -> objectMapper.readValue(TIME_UNFORMATTED_JSON_STR, LocalDateTime.class));
+ () -> objectMapper.readValue(DATE_TIME_UNFORMATTED_JSON_STR, LocalDateTime.class));
+ }
+
+ @Test
+ public void testLocalDateSerialization() throws IOException {
+ LocalDate dateTime = LocalDate.of(2024, 6, 26);
+ String json = objectMapper.writeValueAsString(dateTime);
+ assertEquals(DATE_FORMATTED_JSON_STR, json);
+ }
+
+ @Test
+ public void testLocalDateDeserialization() throws IOException {
+ LocalDate dateTime = objectMapper.readValue(DATE_FORMATTED_JSON_STR, LocalDate.class);
+ assertEquals(LocalDate.of(2024, 6, 26), dateTime);
+ }
+
+ @Test
+ public void testLocalTimeSerialization() throws IOException {
+ LocalTime dateTime = LocalTime.of(13, 1, 30);
+ String json = objectMapper.writeValueAsString(dateTime);
+ assertEquals(TIME_FORMATTED_JSON_STR, json);
+ }
+
+ @Test
+ public void testLocalTimeDeserialization() throws IOException {
+ LocalTime dateTime = objectMapper.readValue(TIME_FORMATTED_JSON_STR, LocalTime.class);
+ assertEquals(LocalTime.of(13, 1, 30), dateTime);
+ }
+
+ @Test
+ public void testDateSerialization() throws IOException {
+ Date date = parseDate(DATE_TIME_STR);
+ String json = objectMapper.writeValueAsString(date);
+ assertEquals(DATE_TIME_FORMATTED_JSON_STR, json);
+ }
+
+ @Test
+ public void testDateDeserialization() throws IOException {
+ Date date = parseDate(DATE_TIME_STR);
+ Date dateDeserialized = objectMapper.readValue(DATE_TIME_FORMATTED_JSON_STR, Date.class);
+ assertEquals(dateDeserialized, date);
+ }
+
+ private Date parseDate(String date) {
+ DateTimeFormatter formatter =
+ DateTimeFormatter.ofPattern(JacksonConfigTests.DATE_TIME_PATTERN);
+
+ LocalDateTime localDateTime = LocalDateTime.parse(date, formatter);
+ ZoneId zoneId = ZoneId.systemDefault();
+ ZonedDateTime zonedDateTime = localDateTime.atZone(zoneId);
+
+ Instant instant = zonedDateTime.toInstant();
+ return Date.from(instant);
}
}
(paimon-webui) 06/07: [Bugfix] Fix deploymentMode can not render correct for editing cluster (#508)
Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
nicholasjiang pushed a commit to branch branch-0.1
in repository https://gitbox.apache.org/repos/asf/paimon-webui.git
commit 10f47a2ad333799ca38e4dca4b2a80cf945e046f
Author: yangyang zhong <35...@users.noreply.github.com>
AuthorDate: Thu Jul 11 23:06:12 2024 +0800
[Bugfix] Fix deploymentMode can not render correct for editing cluster (#508)
---
.../src/views/system/cluster/components/cluster-form/index.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/paimon-web-ui/src/views/system/cluster/components/cluster-form/index.tsx b/paimon-web-ui/src/views/system/cluster/components/cluster-form/index.tsx
index fd1eb0a1..29e0c0fc 100644
--- a/paimon-web-ui/src/views/system/cluster/components/cluster-form/index.tsx
+++ b/paimon-web-ui/src/views/system/cluster/components/cluster-form/index.tsx
@@ -83,7 +83,7 @@ export default defineComponent({
props['onUpdate:formValue']?.({ ...props.formValue, deploymentMode: '' })
}
else if (newType === 'Flink') {
- props['onUpdate:formValue']?.({ ...props.formValue, deploymentMode: deploymentModeFlink[0].value })
+ props['onUpdate:formValue']?.({ ...props.formValue, deploymentMode: props.formValue.deploymentMode || deploymentModeFlink[0].value })
}
})
(paimon-webui) 02/07: [Bugfix] Fix prompt language when deleting users (#500)
Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
nicholasjiang pushed a commit to branch branch-0.1
in repository https://gitbox.apache.org/repos/asf/paimon-webui.git
commit ed42b198a80008901fb594b94d3a5e73bd83f369
Author: XianmingZhou00 <14...@users.noreply.github.com>
AuthorDate: Thu Jul 11 11:31:49 2024 +0800
[Bugfix] Fix prompt language when deleting users (#500)
---
.../org/apache/paimon/web/server/configrue/GlobalExceptionHandler.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/paimon-web-server/src/main/java/org/apache/paimon/web/server/configrue/GlobalExceptionHandler.java b/paimon-web-server/src/main/java/org/apache/paimon/web/server/configrue/GlobalExceptionHandler.java
index 66304928..9bd9cfe8 100644
--- a/paimon-web-server/src/main/java/org/apache/paimon/web/server/configrue/GlobalExceptionHandler.java
+++ b/paimon-web-server/src/main/java/org/apache/paimon/web/server/configrue/GlobalExceptionHandler.java
@@ -58,7 +58,7 @@ public class GlobalExceptionHandler {
if (e.getStatus() == null) {
return R.failed(Status.INTERNAL_SERVER_ERROR_ARGS);
}
- return R.failed(e.getStatus());
+ return R.failed(e.getStatus(), e.getArgs());
}
@ResponseStatus(HttpStatus.UNAUTHORIZED)
(paimon-webui) 07/07: [Feature] Frontend supports query limit (#510)
Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
nicholasjiang pushed a commit to branch branch-0.1
in repository https://gitbox.apache.org/repos/asf/paimon-webui.git
commit eae5f5d82ac33748153e1a94bc73caedd2afc988
Author: yangyang zhong <35...@users.noreply.github.com>
AuthorDate: Fri Jul 12 15:12:03 2024 +0800
[Feature] Frontend supports query limit (#510)
---
paimon-web-ui/src/api/models/job/types/job.ts | 1 +
paimon-web-ui/src/locales/en/modules/playground.ts | 4 +
paimon-web-ui/src/locales/zh/modules/playground.ts | 4 +
.../query/components/debugger/index.module.scss | 14 +-
.../components/query/components/debugger/index.tsx | 146 +++++++++++----------
.../query/components/tabs/index.module.scss | 1 -
6 files changed, 85 insertions(+), 85 deletions(-)
diff --git a/paimon-web-ui/src/api/models/job/types/job.ts b/paimon-web-ui/src/api/models/job/types/job.ts
index 1a1ec2e0..35d01680 100644
--- a/paimon-web-ui/src/api/models/job/types/job.ts
+++ b/paimon-web-ui/src/api/models/job/types/job.ts
@@ -43,6 +43,7 @@ export interface JobSubmitDTO {
}
statements: string
streaming: boolean
+ maxRows: number
}
export interface JobResultData {
diff --git a/paimon-web-ui/src/locales/en/modules/playground.ts b/paimon-web-ui/src/locales/en/modules/playground.ts
index 74810025..d9d1a298 100644
--- a/paimon-web-ui/src/locales/en/modules/playground.ts
+++ b/paimon-web-ui/src/locales/en/modules/playground.ts
@@ -58,4 +58,8 @@ export default {
job_stopping_successfully: 'Job Stopped Successfully',
job_stopping_failed: 'Job Stopped Failed',
data_copied_successfully: 'Data Copied to Clipboard',
+ execution_mode: 'Mode',
+ execution_engine: 'Engine',
+ deployment_cluster: 'Cluster',
+ limit_records: 'Limit',
}
diff --git a/paimon-web-ui/src/locales/zh/modules/playground.ts b/paimon-web-ui/src/locales/zh/modules/playground.ts
index 39ce0510..c88a2233 100644
--- a/paimon-web-ui/src/locales/zh/modules/playground.ts
+++ b/paimon-web-ui/src/locales/zh/modules/playground.ts
@@ -58,4 +58,8 @@ export default {
job_stopping_successfully: '停止任务成功',
job_stopping_failed: '停止任务失败',
data_copied_successfully: '数据已复制到剪贴板',
+ execution_mode: '运行模式',
+ execution_engine: '执行引擎',
+ deployment_cluster: '部署集群',
+ limit_records: '限制行数',
}
diff --git a/paimon-web-ui/src/views/playground/components/query/components/debugger/index.module.scss b/paimon-web-ui/src/views/playground/components/query/components/debugger/index.module.scss
index 0ab88421..c13b8220 100644
--- a/paimon-web-ui/src/views/playground/components/query/components/debugger/index.module.scss
+++ b/paimon-web-ui/src/views/playground/components/query/components/debugger/index.module.scss
@@ -17,18 +17,6 @@ under the License. */
.container {
- display: flex;
- align-items: center;
width: 100%;
- height: 100%;
-
- .run {
- display: flex;
- }
-
- .operations {
- display: flex;
- flex: 1;
- justify-content: flex-end;
- }
+ height: 60px;
}
diff --git a/paimon-web-ui/src/views/playground/components/query/components/debugger/index.tsx b/paimon-web-ui/src/views/playground/components/query/components/debugger/index.tsx
index 3a5e5794..f3b62561 100644
--- a/paimon-web-ui/src/views/playground/components/query/components/debugger/index.tsx
+++ b/paimon-web-ui/src/views/playground/components/query/components/debugger/index.tsx
@@ -15,7 +15,7 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License. */
-import { ChevronDown, Pause, Play, Reload, Save } from '@vicons/ionicons5'
+import { Pause, Play, Reload, Save } from '@vicons/ionicons5'
import { FormatAlignLeftOutlined } from '@vicons/material'
import { NInput, useMessage } from 'naive-ui'
@@ -60,22 +60,25 @@ export default defineComponent({
})
const debuggerVariables = reactive<{
- operatingConditionOptions: { label: string, key: string }[]
+ operatingConditionOptions: { label: string, value: number }[]
conditionValue: string
- bigDataOptions: { label: string, value: string }[]
+ bigDataOptions: { label: string, value: string, disabled?: boolean }[]
conditionValue2: string
clusterOptions: { label: string, value: string }[]
conditionValue3: string
+ maxRows: number
executionModeOptions: { label: string, value: string }[]
}>({
operatingConditionOptions: [
- { label: 'Limit 100 items', key: '100' },
- { label: 'Limit 1000 items', key: '1000' },
+ { label: '500', value: 500 },
+ { label: '1000', value: 1000 },
+ { label: '2000', value: 2000 },
+ { label: '5000', value: 5000 },
+ { label: 'ALL', value: 2147483647 },
],
conditionValue: 'Flink',
bigDataOptions: [
{ label: 'Flink', value: 'Flink' },
- { label: 'Spark', value: 'Spark' },
],
conditionValue2: '',
clusterOptions: [],
@@ -84,6 +87,7 @@ export default defineComponent({
{ label: 'Streaming', value: 'Streaming' },
{ label: 'Batch', value: 'Batch' },
],
+ maxRows: 500,
})
const handleSelect = () => {
@@ -230,6 +234,7 @@ export default defineComponent({
clusterId: debuggerVariables.conditionValue2,
statements: currentSQL,
streaming: debuggerVariables.conditionValue3 === 'Streaming',
+ maxRows: debuggerVariables.maxRows,
}
try {
@@ -269,8 +274,8 @@ export default defineComponent({
},
render() {
return (
- <div class={styles.container}>
- <n-space>
+ <n-space justify="space-between" class={styles.container} align="center">
+ <n-space align="center">
<n-button
type="primary"
loading={this.isSubmitting}
@@ -281,76 +286,75 @@ export default defineComponent({
return (
<div class={styles.run}>
{this.jobStatus === 'RUNNING' ? this.t('playground.stop') : this.t('playground.run')}
- <n-divider vertical />
- <n-dropdown trigger="hover" show-arrow options={this.operatingConditionOptions} on-select={this.handleSelect}>
- <n-icon component={ChevronDown} />
- </n-dropdown>
</div>
)
},
}}
>
</n-button>
- <n-select style="width:160px;" v-model:value={this.conditionValue} options={this.bigDataOptions} />
- <n-select style="width:160px;" v-model:value={this.conditionValue2} options={this.clusterOptions} />
- <n-select style="width:160px;" v-model:value={this.conditionValue3} options={this.executionModeOptions} />
+ <span>{this.t('playground.execution_mode')}</span>
+ <n-select style="width:110px;" v-model:value={this.conditionValue3} options={this.executionModeOptions} />
+ <span>{this.t('playground.execution_engine')}</span>
+ <n-select style="width:110px;" v-model:value={this.conditionValue} options={this.bigDataOptions} />
+ <span>{this.t('playground.deployment_cluster')}</span>
+ <n-select style="width:150px;" v-model:value={this.conditionValue2} options={this.clusterOptions} />
+ <span>{this.t('playground.limit_records')}</span>
+ <n-select style="width:100px;" v-model:value={this.maxRows} options={this.operatingConditionOptions} />
</n-space>
- <div class={styles.operations}>
- <n-space>
- <n-popover
- trigger="hover"
- placement="bottom"
- v-slots={{
- trigger: () => (
- <n-button
- onClick={this.handleFormat}
- v-slots={{
- icon: () => <n-icon component={FormatAlignLeftOutlined}></n-icon>,
- }}
- >
- </n-button>
- ),
- }}
- >
- <span>{this.t('playground.format')}</span>
- </n-popover>
- <n-popover
- trigger="hover"
- placement="bottom"
- v-slots={{
- trigger: () => (
- <n-button
- onClick={this.handleReload}
- v-slots={{
- icon: () => <n-icon component={Reload}></n-icon>,
- }}
- >
- </n-button>
- ),
- }}
- >
- <span>{this.t('playground.reload')}</span>
- </n-popover>
- <n-popover
- trigger="hover"
- placement="bottom"
- v-slots={{
- trigger: () => (
- <n-button
- onClick={this.handleSave}
- v-slots={{
- icon: () => <n-icon component={Save}></n-icon>,
- }}
- >
- </n-button>
- ),
- }}
- >
- <span>{this.t('playground.save')}</span>
- </n-popover>
- </n-space>
- </div>
- </div>
+ <n-space align="center">
+ <n-popover
+ trigger="hover"
+ placement="bottom"
+ v-slots={{
+ trigger: () => (
+ <n-button
+ onClick={this.handleFormat}
+ v-slots={{
+ icon: () => <n-icon component={FormatAlignLeftOutlined}></n-icon>,
+ }}
+ >
+ </n-button>
+ ),
+ }}
+ >
+ <span>{this.t('playground.format')}</span>
+ </n-popover>
+ <n-popover
+ trigger="hover"
+ placement="bottom"
+ v-slots={{
+ trigger: () => (
+ <n-button
+ onClick={this.handleReload}
+ v-slots={{
+ icon: () => <n-icon component={Reload}></n-icon>,
+ }}
+ >
+ </n-button>
+ ),
+ }}
+ >
+ <span>{this.t('playground.reload')}</span>
+ </n-popover>
+ <n-popover
+ trigger="hover"
+ placement="bottom"
+ v-slots={{
+ trigger: () => (
+ <n-button
+ onClick={this.handleSave}
+ v-slots={{
+ icon: () => <n-icon component={Save}></n-icon>,
+ }}
+ >
+ </n-button>
+ ),
+ }}
+ >
+ <span>{this.t('playground.save')}</span>
+ </n-popover>
+ </n-space>
+ </n-space>
)
},
})
diff --git a/paimon-web-ui/src/views/playground/components/query/components/tabs/index.module.scss b/paimon-web-ui/src/views/playground/components/query/components/tabs/index.module.scss
index f05e5766..f09c3b84 100644
--- a/paimon-web-ui/src/views/playground/components/query/components/tabs/index.module.scss
+++ b/paimon-web-ui/src/views/playground/components/query/components/tabs/index.module.scss
@@ -37,7 +37,6 @@ under the License. */
}
.debugger {
- display: flex;
height: 60px;
}