Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature](step:one)Add arrow format #161

Merged
merged 4 commits into from
Dec 8, 2023

Conversation

wuwenchi
Copy link
Contributor

Proposed changes

Issue Number: close #xxx

Problem Summary:

Describe the overview of changes.

Checklist(Required)

  1. Does it affect the original behavior: (Yes/No/I Don't know)
  2. Has unit tests been added: (Yes/No/No Need)
  3. Has document been added or modified: (Yes/No/No Need)
  4. Does it need to update dependencies: (Yes/No)
  5. Are there any changes that cannot be rolled back: (Yes/No)

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@wuwenchi wuwenchi marked this pull request as draft November 16, 2023 07:44
@wuwenchi wuwenchi marked this pull request as ready for review November 29, 2023 12:45
private RecordBatch(Iterator<InternalRow> iterator, String format, String sep, byte[] delim,
private VectorSchemaRoot arrowRoot = null;

private int arrowBatchSize = 1000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this variable be configured? Or is this the best performance value obtained through testing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the number obtained after comparing the performance of arrows when testing the performance.
However, there may be other scenarios, and perhaps a configuration item can be added

@wuwenchi wuwenchi requested a review from JNSimba December 6, 2023 02:35
@JNSimba
Copy link
Member

JNSimba commented Dec 6, 2023

There are some code conflicts, please fix them, thank you

@@ -72,7 +72,7 @@
<spark.major.version>3.1</spark.major.version>
<scala.version>2.12</scala.version>
<libthrift.version>0.16.0</libthrift.version>
<arrow.version>5.0.0</arrow.version>
<arrow.version>13.0.0</arrow.version>
Copy link
Contributor Author

@wuwenchi wuwenchi Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as doris

Comment on lines +85 to 91
byte[] bytes = new byte[1];
int read = read(bytes, 0, 1);
if (read < 0) {
return -1;
} else {
return bytes[0];
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use same logic from read(x,x,x)

@@ -31,10 +31,8 @@
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seem useless, delete...

import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seem useless, delete...


object ArrowSchemaUtils {
def toArrowSchema(schema: StructType, timeZoneId: String): Schema = {
ArrowUtils.toArrowSchema(schema, timeZoneId)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a direct call to the Spark function, because ArrowUtils is private in org.apache.spark.sql

Copy link
Member

@JNSimba JNSimba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@JNSimba JNSimba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JNSimba JNSimba merged commit 4849ee7 into apache:master Dec 8, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants