From 3e8311862084fa9959470a657647e2e7344f3439 Mon Sep 17 00:00:00 2001 From: xxzuo <1293378490@qq.com> Date: Tue, 23 Jan 2024 17:22:28 +0800 Subject: [PATCH] [Fix-340][Engine] Local engine, mysql supports fields whose names are mysql keywords --- .../java/io/datavines/connector/plugin/MysqlDialect.java | 5 +++++ .../engine/local/config/BaseLocalConfigurationBuilder.java | 2 ++ 2 files changed, 7 insertions(+) diff --git a/datavines-connector/datavines-connector-plugins/datavines-connector-mysql/src/main/java/io/datavines/connector/plugin/MysqlDialect.java b/datavines-connector/datavines-connector-plugins/datavines-connector-mysql/src/main/java/io/datavines/connector/plugin/MysqlDialect.java index 7af11d29c..2d1150f2b 100644 --- a/datavines-connector/datavines-connector-plugins/datavines-connector-mysql/src/main/java/io/datavines/connector/plugin/MysqlDialect.java +++ b/datavines-connector/datavines-connector-plugins/datavines-connector-mysql/src/main/java/io/datavines/connector/plugin/MysqlDialect.java @@ -43,4 +43,9 @@ public boolean invalidateItemCanOutputToSelf() { public boolean supportToBeErrorDataStorage() { return true; } + + @Override + public String quoteIdentifier(String entity) { + return "`" + entity + "`"; + } } diff --git a/datavines-engine/datavines-engine-plugins/datavines-engine-local/datavines-engine-local-config/src/main/java/io/datavines/engine/local/config/BaseLocalConfigurationBuilder.java b/datavines-engine/datavines-engine-plugins/datavines-engine-local/datavines-engine-local-config/src/main/java/io/datavines/engine/local/config/BaseLocalConfigurationBuilder.java index df3d8e6b0..7d2af0a7a 100644 --- a/datavines-engine/datavines-engine-plugins/datavines-engine-local/datavines-engine-local-config/src/main/java/io/datavines/engine/local/config/BaseLocalConfigurationBuilder.java +++ b/datavines-engine/datavines-engine-plugins/datavines-engine-local/datavines-engine-local-config/src/main/java/io/datavines/engine/local/config/BaseLocalConfigurationBuilder.java @@ -98,6 +98,8 @@ protected List getSourceConfigs() throws DataVinesException { metricInputParameter.put(SRC_CONNECTOR_TYPE, connectorParameter.getType()); metricInputParameter.put(TABLE, table); + metricInputParameter.put(COLUMN, connectorFactory.getDialect().quoteIdentifier(metricInputParameter.get(COLUMN))); + boolean invalidateItemCanOutput = Boolean.parseBoolean(metricInputParameter.get(INVALIDATE_ITEM_CAN_OUTPUT)); invalidateItemCanOutput &= connectorFactory.getDialect().invalidateItemCanOutput(); metricInputParameter.put(INVALIDATE_ITEM_CAN_OUTPUT, String.valueOf(invalidateItemCanOutput));