From b195bf3994eb6299d79076c5d3592b2fc57b94f9 Mon Sep 17 00:00:00 2001 From: guojn1 Date: Wed, 20 Nov 2024 09:53:36 +0800 Subject: [PATCH] [fix][dingo-store-proxy] Resolve IndexMapper.toIndex mapping errors --- dingo-calcite/src/main/codegen/includes/AlterTable.ftl | 6 +----- .../src/main/java/io/dingodb/meta/MetaService.java | 8 -------- .../java/io/dingodb/store/proxy/mapper/IndexMapper.java | 6 +++++- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/dingo-calcite/src/main/codegen/includes/AlterTable.ftl b/dingo-calcite/src/main/codegen/includes/AlterTable.ftl index 51c663c9a4..ec56f98657 100644 --- a/dingo-calcite/src/main/codegen/includes/AlterTable.ftl +++ b/dingo-calcite/src/main/codegen/includes/AlterTable.ftl @@ -184,11 +184,7 @@ SqlAlterTable addUniqueIndex(Span s, String scope, SqlIdentifier id): { } { { s.add(this); } { index = getNextToken().image; } - ( - { indexType = "vector"; } columnList = ParenthesizedSimpleIdentifierList() - | - [] columnList = ParenthesizedSimpleIdentifierList() - ) + [] columnList = ParenthesizedSimpleIdentifierList() ( withColumnList = ParenthesizedSimpleIdentifierList() | diff --git a/dingo-meta-api/src/main/java/io/dingodb/meta/MetaService.java b/dingo-meta-api/src/main/java/io/dingodb/meta/MetaService.java index 210c7ff21e..b2420fa535 100644 --- a/dingo-meta-api/src/main/java/io/dingodb/meta/MetaService.java +++ b/dingo-meta-api/src/main/java/io/dingodb/meta/MetaService.java @@ -119,13 +119,6 @@ default long createTables( return 0; } - default void rollbackCreateTable( - @NonNull TableDefinition tableDefinition, - @NonNull List indexTableDefinitions - ) { - - } - default void rollbackCreateTable( long schemaId, @NonNull TableDefinition tableDefinition, @@ -151,7 +144,6 @@ default void updateTable(CommonId tableId, @NonNull Table table) { long truncateTable(@NonNull String tableName, long tableEntityId); -// boolean dropTables(@NonNull Collection tableIds); /** * Get table by table name. diff --git a/dingo-store-proxy/src/main/java/io/dingodb/store/proxy/mapper/IndexMapper.java b/dingo-store-proxy/src/main/java/io/dingodb/store/proxy/mapper/IndexMapper.java index e0c0c3127b..4f15841b8a 100644 --- a/dingo-store-proxy/src/main/java/io/dingodb/store/proxy/mapper/IndexMapper.java +++ b/dingo-store-proxy/src/main/java/io/dingodb/store/proxy/mapper/IndexMapper.java @@ -101,7 +101,11 @@ default Properties toMap(Object target) { if (target == null) { return new Properties(); } - return JSON.convertValue(target, Properties.class); + try { + return JSON.convertValue(target, Properties.class); + } catch (Exception e) { + return new Properties(); + } } default void resetIndexParameter(TableDefinition indexDefinition, io.dingodb.common.table.IndexDefinition indexDef) {