configurationList = config.getListConfiguration(Key.COLUMN);
+ for (Configuration column : configurationList) {
+ ColumnType columnType;
+ try {
+ columnType = ColumnType.valueOf(column.getString(Key.COLUMN_NODE_TYPE));
+ } catch (NullPointerException | IllegalArgumentException e) {
+ throw DataXException.asDataXException(GdbReaderErrorCode.BAD_CONFIG_VALUE, Key.COLUMN_NODE_TYPE);
+ }
+
+ if (exportType == ExportType.VERTEX) {
+ // only id/label/property column allow when vertex
+ ConfigHelper.assertConfig(Key.COLUMN_NODE_TYPE, () ->
+ columnType == ColumnType.primaryKey || columnType == ColumnType.primaryLabel
+ || columnType == ColumnType.vertexProperty || columnType == ColumnType.vertexJsonProperty);
+ } else if (exportType == ExportType.EDGE) {
+ // edge
+ ConfigHelper.assertConfig(Key.COLUMN_NODE_TYPE, () ->
+ columnType == ColumnType.primaryKey || columnType == ColumnType.primaryLabel
+ || columnType == ColumnType.srcPrimaryKey || columnType == ColumnType.srcPrimaryLabel
+ || columnType == ColumnType.dstPrimaryKey || columnType == ColumnType.dstPrimaryLabel
+ || columnType == ColumnType.edgeProperty || columnType == ColumnType.edgeJsonProperty);
+ }
+
+ if (columnType == ColumnType.edgeProperty || columnType == ColumnType.vertexProperty) {
+ String name = column.getString(Key.COLUMN_NAME);
+ ValueType propType = ValueType.fromShortName(column.getString(Key.COLUMN_TYPE));
+
+ ConfigHelper.assertConfig(Key.COLUMN_NAME, () -> name != null);
+ if (propType == null) {
+ throw DataXException.asDataXException(GdbReaderErrorCode.UNSUPPORTED_TYPE, Key.COLUMN_TYPE);
+ }
+ rule.addColumn(columnType, propType, name);
+ } else if (columnType == ColumnType.vertexJsonProperty || columnType == ColumnType.edgeJsonProperty) {
+ rule.addJsonColumn(columnType);
+ } else {
+ rule.addColumn(columnType, ValueType.STRING, null);
+ }
+ }
+ return rule;
+ }
+}
diff --git a/gdbreader/src/main/java/com/alibaba/datax/plugin/reader/gdbreader/mapping/ValueType.java b/gdbreader/src/main/java/com/alibaba/datax/plugin/reader/gdbreader/mapping/ValueType.java
new file mode 100644
index 00000000..826e0493
--- /dev/null
+++ b/gdbreader/src/main/java/com/alibaba/datax/plugin/reader/gdbreader/mapping/ValueType.java
@@ -0,0 +1,128 @@
+/*
+ * (C) 2019-present Alibaba Group Holding Limited.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+package com.alibaba.datax.plugin.reader.gdbreader.mapping;
+
+import com.alibaba.datax.common.element.BoolColumn;
+import com.alibaba.datax.common.element.Column;
+import com.alibaba.datax.common.element.DoubleColumn;
+import com.alibaba.datax.common.element.LongColumn;
+import com.alibaba.datax.common.element.StringColumn;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.function.Function;
+
+/**
+ * @author : Liu Jianping
+ * @date : 2019/9/6
+ */
+
+public enum ValueType {
+ /**
+ * transfer gdb element object value to DataX Column data
+ *
+ * int, long -> LongColumn
+ * float, double -> DoubleColumn
+ * bool -> BooleanColumn
+ * string -> StringColumn
+ */
+ INT(Integer.class, "int", ValueTypeHolder::longColumnMapper),
+ INTEGER(Integer.class, "integer", ValueTypeHolder::longColumnMapper),
+ LONG(Long.class, "long", ValueTypeHolder::longColumnMapper),
+ DOUBLE(Double.class, "double", ValueTypeHolder::doubleColumnMapper),
+ FLOAT(Float.class, "float", ValueTypeHolder::doubleColumnMapper),
+ BOOLEAN(Boolean.class, "boolean", ValueTypeHolder::boolColumnMapper),
+ STRING(String.class, "string", ValueTypeHolder::stringColumnMapper),
+ ;
+
+ private Class> type = null;
+ private String shortName = null;
+ private Function