You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by we...@apache.org on 2022/07/03 04:51:49 UTC
[incubator-seatunnel] branch dev updated: [Bug] [seatunnel-connector-flink-fake] Type is not supported: BigInteger (#2118)
This is an automated email from the ASF dual-hosted git repository.
wenjun pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-seatunnel.git
The following commit(s) were added to refs/heads/dev by this push:
new 528c6fdea [Bug] [seatunnel-connector-flink-fake] Type is not supported: BigInteger (#2118)
528c6fdea is described below
commit 528c6fdeae34763193ca923099c88edcad5904d7
Author: gleiyu <gl...@sina.cn>
AuthorDate: Sun Jul 3 12:51:44 2022 +0800
[Bug] [seatunnel-connector-flink-fake] Type is not supported: BigInteger (#2118)
* remove biginteger
---
docs/en/connector/source/Fake.mdx | 2 +-
.../seatunnel/flink/fake/source/MockSchema.java | 19 ++++++-------------
2 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/docs/en/connector/source/Fake.mdx b/docs/en/connector/source/Fake.mdx
index 4487f8281..12a6c2bfb 100644
--- a/docs/en/connector/source/Fake.mdx
+++ b/docs/en/connector/source/Fake.mdx
@@ -100,7 +100,7 @@ column_config option type.
| name | type | required | default value | support values |
|-------------|-------------|----------|---------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| name | string | yes | string | - |
-| type | string | yes | string | int,integer,byte,boolean,char,<br/>character,short,long,float,double,<br/>date,timestamp,decimal,bigdecimal,<br/>bigint,biginteger,int[],byte[],<br/>boolean[],char[],character[],short[],<br/>long[],float[],double[],string[],<br/>binary,varchar |
+| type | string | yes | string | int,integer,byte,boolean,char,<br/>character,short,long,float,double,<br/>date,timestamp,decimal,bigdecimal,<br/>bigint,int[],byte[],<br/>boolean[],char[],character[],short[],<br/>long[],float[],double[],string[],<br/>binary,varchar |
| mock_config | mock_config | no | - | - |
mock_config Option
diff --git a/seatunnel-connectors/seatunnel-connectors-flink/seatunnel-connector-flink-fake/src/main/java/org/apache/seatunnel/flink/fake/source/MockSchema.java b/seatunnel-connectors/seatunnel-connectors-flink/seatunnel-connector-flink-fake/src/main/java/org/apache/seatunnel/flink/fake/source/MockSchema.java
index b8f0428d1..37f1b3372 100644
--- a/seatunnel-connectors/seatunnel-connectors-flink/seatunnel-connector-flink-fake/src/main/java/org/apache/seatunnel/flink/fake/source/MockSchema.java
+++ b/seatunnel-connectors/seatunnel-connectors-flink/seatunnel-connector-flink-fake/src/main/java/org/apache/seatunnel/flink/fake/source/MockSchema.java
@@ -53,7 +53,6 @@ import org.apache.flink.types.Row;
import java.io.ByteArrayInputStream;
import java.io.Serializable;
import java.math.BigDecimal;
-import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.sql.Timestamp;
import java.util.ArrayList;
@@ -132,6 +131,7 @@ public class MockSchema implements Serializable {
dataType = BasicTypeInfo.SHORT_TYPE_INFO;
break;
case "long":
+ case "bigint":
dataType = BasicTypeInfo.LONG_TYPE_INFO;
break;
case "float":
@@ -150,10 +150,6 @@ public class MockSchema implements Serializable {
case "bigdecimal":
dataType = BasicTypeInfo.BIG_DEC_TYPE_INFO;
break;
- case "bigint":
- case "biginteger":
- dataType = BasicTypeInfo.BIG_INT_TYPE_INFO;
- break;
case "int[]":
dataType = PrimitiveArrayTypeInfo.INT_PRIMITIVE_ARRAY_TYPE_INFO;
break;
@@ -193,11 +189,11 @@ public class MockSchema implements Serializable {
return dataType;
}
- public Object mockData(){
+ public Object mockData() {
Object mockData;
MockConfig mockConfig = new MockConfig();
resolve(mockConfig);
- switch (this.type.trim().toLowerCase()){
+ switch (this.type.trim().toLowerCase()) {
case "int":
case "integer":
mockData = JMockData.mock(int.class, mockConfig);
@@ -216,6 +212,7 @@ public class MockSchema implements Serializable {
mockData = JMockData.mock(short.class, mockConfig);
break;
case "long":
+ case "bigint":
mockData = JMockData.mock(long.class, mockConfig);
break;
case "float":
@@ -234,10 +231,6 @@ public class MockSchema implements Serializable {
case "bigdecimal":
mockData = JMockData.mock(BigDecimal.class, mockConfig);
break;
- case "bigint":
- case "biginteger":
- mockData = JMockData.mock(BigInteger.class, mockConfig);
- break;
case "int[]":
mockData = JMockData.mock(int[].class, mockConfig);
break;
@@ -426,7 +419,7 @@ public class MockSchema implements Serializable {
return new RowTypeInfo(types, fieldNames);
}
- public static Row mockRowData(List<MockSchema> mockDataSchema){
+ public static Row mockRowData(List<MockSchema> mockDataSchema) {
Object[] fieldByPosition = new Object[mockDataSchema.size()];
for (int index = 0; index < mockDataSchema.size(); index++) {
MockSchema schema = mockDataSchema.get(index);
@@ -470,7 +463,7 @@ public class MockSchema implements Serializable {
DEFAULT_MOCK_SCHEMAS.add(ageSchema);
}
- public static List<MockSchema> resolveConfig(Config config){
+ public static List<MockSchema> resolveConfig(Config config) {
if (config.hasPath(MOCK_DATA_SCHEMA)) {
return config.getConfigList(MOCK_DATA_SCHEMA)
.stream()