-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature][core] support arrow transfers data to SeatunnelRow in arrow…
… format
- Loading branch information
Showing
61 changed files
with
2,615 additions
and
1,204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
.../apache/seatunnel/connectors/seatunnel/common/source/arrow/converter/BigIntConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* 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.seatunnel.connectors.seatunnel.common.source.arrow.converter; | ||
|
||
import org.apache.seatunnel.shade.org.apache.arrow.vector.BigIntVector; | ||
import org.apache.seatunnel.shade.org.apache.arrow.vector.types.Types; | ||
|
||
public class BigIntConverter implements Converter<BigIntVector> { | ||
@Override | ||
public Object convert(int rowIndex, BigIntVector fieldVector) { | ||
return fieldVector.isNull(rowIndex) ? null : fieldVector.getObject(rowIndex); | ||
} | ||
|
||
@Override | ||
public boolean support(Types.MinorType type) { | ||
return Types.MinorType.BIGINT == type; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...org/apache/seatunnel/connectors/seatunnel/common/source/arrow/converter/BitConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* 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.seatunnel.connectors.seatunnel.common.source.arrow.converter; | ||
|
||
import org.apache.seatunnel.shade.org.apache.arrow.vector.BitVector; | ||
import org.apache.seatunnel.shade.org.apache.arrow.vector.types.Types; | ||
|
||
public class BitConverter implements Converter<BitVector> { | ||
@Override | ||
public Object convert(int rowIndex, BitVector fieldVector) { | ||
return fieldVector.isNull(rowIndex) ? null : fieldVector.getObject(rowIndex); | ||
} | ||
|
||
@Override | ||
public boolean support(Types.MinorType type) { | ||
return Types.MinorType.BIT == type; | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
...va/org/apache/seatunnel/connectors/seatunnel/common/source/arrow/converter/Converter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* 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.seatunnel.connectors.seatunnel.common.source.arrow.converter; | ||
|
||
import org.apache.seatunnel.shade.org.apache.arrow.vector.FieldVector; | ||
import org.apache.seatunnel.shade.org.apache.arrow.vector.types.Types; | ||
|
||
import java.util.List; | ||
import java.util.function.Function; | ||
|
||
public interface Converter<T extends FieldVector> { | ||
|
||
Object convert(int rowIndex, T fieldVector); | ||
|
||
default Object convert(int rowIndex, T fieldVector, List<Function> genericsConvert) { | ||
throw new UnsupportedOperationException("Unsupported generics convert"); | ||
} | ||
|
||
boolean support(Types.MinorType type); | ||
} |
33 changes: 33 additions & 0 deletions
33
...apache/seatunnel/connectors/seatunnel/common/source/arrow/converter/DateDayConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* 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.seatunnel.connectors.seatunnel.common.source.arrow.converter; | ||
|
||
import org.apache.seatunnel.shade.org.apache.arrow.vector.DateDayVector; | ||
import org.apache.seatunnel.shade.org.apache.arrow.vector.types.Types; | ||
|
||
public class DateDayConverter implements Converter<DateDayVector> { | ||
@Override | ||
public Object convert(int rowIndex, DateDayVector fieldVector) { | ||
return fieldVector.isNull(rowIndex) ? null : fieldVector.getObject(rowIndex); | ||
} | ||
|
||
@Override | ||
public boolean support(Types.MinorType type) { | ||
return Types.MinorType.DATEDAY == type; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...ache/seatunnel/connectors/seatunnel/common/source/arrow/converter/DateMilliConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* 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.seatunnel.connectors.seatunnel.common.source.arrow.converter; | ||
|
||
import org.apache.seatunnel.shade.org.apache.arrow.vector.DateMilliVector; | ||
import org.apache.seatunnel.shade.org.apache.arrow.vector.types.Types; | ||
|
||
public class DateMilliConverter implements Converter<DateMilliVector> { | ||
@Override | ||
public Object convert(int rowIndex, DateMilliVector fieldVector) { | ||
return fieldVector.isNull(rowIndex) ? null : fieldVector.getObject(rowIndex); | ||
} | ||
|
||
@Override | ||
public boolean support(Types.MinorType type) { | ||
return Types.MinorType.DATEMILLI == type; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...che/seatunnel/connectors/seatunnel/common/source/arrow/converter/Decimal256Converter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* 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.seatunnel.connectors.seatunnel.common.source.arrow.converter; | ||
|
||
import org.apache.seatunnel.shade.org.apache.arrow.vector.Decimal256Vector; | ||
import org.apache.seatunnel.shade.org.apache.arrow.vector.types.Types; | ||
|
||
public class Decimal256Converter implements Converter<Decimal256Vector> { | ||
@Override | ||
public Object convert(int rowIndex, Decimal256Vector fieldVector) { | ||
return fieldVector.isNull(rowIndex) ? null : fieldVector.getObject(rowIndex); | ||
} | ||
|
||
@Override | ||
public boolean support(Types.MinorType type) { | ||
return Types.MinorType.DECIMAL256 == type; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...apache/seatunnel/connectors/seatunnel/common/source/arrow/converter/DecimalConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* 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.seatunnel.connectors.seatunnel.common.source.arrow.converter; | ||
|
||
import org.apache.seatunnel.shade.org.apache.arrow.vector.DecimalVector; | ||
import org.apache.seatunnel.shade.org.apache.arrow.vector.types.Types; | ||
|
||
public class DecimalConverter implements Converter<DecimalVector> { | ||
@Override | ||
public Object convert(int rowIndex, DecimalVector fieldVector) { | ||
return fieldVector.isNull(rowIndex) ? null : fieldVector.getObject(rowIndex); | ||
} | ||
|
||
@Override | ||
public boolean support(Types.MinorType type) { | ||
return Types.MinorType.DECIMAL == type; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...che/seatunnel/connectors/seatunnel/common/source/arrow/converter/DenseUnionConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* 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.seatunnel.connectors.seatunnel.common.source.arrow.converter; | ||
|
||
import org.apache.seatunnel.shade.org.apache.arrow.vector.complex.DenseUnionVector; | ||
import org.apache.seatunnel.shade.org.apache.arrow.vector.types.Types; | ||
|
||
public class DenseUnionConverter implements Converter<DenseUnionVector> { | ||
@Override | ||
public Object convert(int rowIndex, DenseUnionVector fieldVector) { | ||
return fieldVector.isNull(rowIndex) ? null : fieldVector.getObject(rowIndex); | ||
} | ||
|
||
@Override | ||
public boolean support(Types.MinorType type) { | ||
return Types.MinorType.DENSEUNION == type; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...pache/seatunnel/connectors/seatunnel/common/source/arrow/converter/DurationConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* 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.seatunnel.connectors.seatunnel.common.source.arrow.converter; | ||
|
||
import org.apache.seatunnel.shade.org.apache.arrow.vector.DurationVector; | ||
import org.apache.seatunnel.shade.org.apache.arrow.vector.types.Types; | ||
|
||
public class DurationConverter implements Converter<DurationVector> { | ||
@Override | ||
public Object convert(int rowIndex, DurationVector fieldVector) { | ||
return fieldVector.isNull(rowIndex) ? null : fieldVector.getObject(rowIndex); | ||
} | ||
|
||
@Override | ||
public boolean support(Types.MinorType type) { | ||
return Types.MinorType.DURATION == type; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
.../seatunnel/connectors/seatunnel/common/source/arrow/converter/ExtensionTypeConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* 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.seatunnel.connectors.seatunnel.common.source.arrow.converter; | ||
|
||
import org.apache.seatunnel.shade.org.apache.arrow.vector.ExtensionTypeVector; | ||
import org.apache.seatunnel.shade.org.apache.arrow.vector.types.Types; | ||
|
||
public class ExtensionTypeConverter implements Converter<ExtensionTypeVector> { | ||
@Override | ||
public Object convert(int rowIndex, ExtensionTypeVector fieldVector) { | ||
return fieldVector.isNull(rowIndex) ? null : fieldVector.getObject(rowIndex); | ||
} | ||
|
||
@Override | ||
public boolean support(Types.MinorType type) { | ||
return Types.MinorType.EXTENSIONTYPE == type; | ||
} | ||
} |
Oops, something went wrong.