-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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] [File Connector] Supports writing column names when the output type is file (CSV) #5459
Conversation
…put type is file (CSV) apache#5443
@@ -133,15 +133,21 @@ private FSDataOutputStream getOrCreateOutputStream(@NonNull String filePath) { | |||
OutputStream out = | |||
lzo.createOutputStream(fileSystemUtils.getOutputStream(filePath)); | |||
fsDataOutputStream = new FSDataOutputStream(out, null); | |||
fsDataOutputStream.write(String.join(",", seaTunnelRowType.getFieldNames()).getBytes()); | |||
fsDataOutputStream.write(System.lineSeparator().getBytes()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use fsDataOutputStream.write(rowDelimiter.getBytes());
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah,i will fix it
break; | ||
case NONE: | ||
fsDataOutputStream = fileSystemUtils.getOutputStream(filePath); | ||
fsDataOutputStream.write(String.join(",", seaTunnelRowType.getFieldNames()).getBytes()); | ||
fsDataOutputStream.write(System.lineSeparator().getBytes()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
Please fix code style by run |
i will fix it |
@@ -166,6 +167,10 @@ When File Format is Excel,The maximum number of data items that can be cached in | |||
|
|||
Writer the sheet of the workbook | |||
|
|||
### enable_header_write [boolean] | |||
|
|||
false:dont write header,true:write header. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems you only implement this in text format, if so it's needed to mention this only support in text format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah,i will fix it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
support text and csv
Please fix CI error. |
yeah. fix it ok. |
…put type is file (CSV) apache#5443
…eader,true:write header. apache#5443
…put type is file (CSV) apache#5443
…eader,true:write header. apache#5443
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job!
…put type is file (CSV) (apache#5459) * [Feature] [File Connector] Supports writing column names when the output type is file (CSV) apache#5443 * [Feature] [File Connector] fix code style and lineSeparator apache#5443 * [Feature] [File Connector] add enable_header_write,false:dont write header,true:write header. apache#5443 * [Feature] [File Connector] fix code style apache#5443 * [Feature] [File Connector] add enable_header_write explain apache#5443 * [Feature] [File Connector]fix code style apache#5443 * Update docs/en/connector-v2/sink/LocalFile.md * Update docs/en/connector-v2/sink/LocalFile.md * [Feature] [File Connector]fix code style apache#5443 * [Feature] [File Connector]add junit test apache#5443 * [Feature] [File Connector]add license header: apache#5443 * [Feature] [File Connector] Supports writing column names when the output type is file (CSV) apache#5443 * [Feature] [File Connector] fix code style and lineSeparator apache#5443 * [Feature] [File Connector] add enable_header_write,false:dont write header,true:write header. apache#5443 * [Feature] [File Connector] fix code style apache#5443 * [Feature] [File Connector] add enable_header_write explain apache#5443 * [Feature] [File Connector]fix code style apache#5443 * Update docs/en/connector-v2/sink/LocalFile.md * Update docs/en/connector-v2/sink/LocalFile.md * [Feature] [File Connector]fix code style apache#5443 * [Feature] [File Connector]add junit test apache#5443 * [Feature] [File Connector]add license header: apache#5443 * [Feature] [File Connector]add junit: apache#5443 * [Feature] [File Connector]add junit: apache#5443 * [Feature] [File Connector]remove scala: apache#5443 * [Feature] [File Connector]modify md style: apache#5443 * [Feature] [File Connector] Supports writing column names when the output type is file (CSV) apache#5443 * [Feature] [File Connector] fix code style and lineSeparator apache#5443 * [Feature] [File Connector] add enable_header_write,false:dont write header,true:write header. apache#5443 * [Feature] [File Connector] fix code style apache#5443 * [Feature] [File Connector] add enable_header_write explain apache#5443 * [Feature] [File Connector]fix code style apache#5443 * Update docs/en/connector-v2/sink/LocalFile.md * Update docs/en/connector-v2/sink/LocalFile.md * [Feature] [File Connector]fix code style apache#5443 * [Feature] [File Connector]add junit test apache#5443 * [Feature] [File Connector]add license header: apache#5443 * [Feature] [File Connector]add junit: apache#5443 * [Feature] [File Connector]add junit: apache#5443 * [Feature] [File Connector]remove scala: apache#5443 * [Feature] [File Connector]modify md style: apache#5443 * [Feature] [File Connector]junit modify: apache#5443 --------- Co-authored-by: zck <573693104@qq.com> Co-authored-by: Eric <gaojun2048@gmail.com>
…put type is file (CSV) (apache#5459) * [Feature] [File Connector] Supports writing column names when the output type is file (CSV) apache#5443 * [Feature] [File Connector] fix code style and lineSeparator apache#5443 * [Feature] [File Connector] add enable_header_write,false:dont write header,true:write header. apache#5443 * [Feature] [File Connector] fix code style apache#5443 * [Feature] [File Connector] add enable_header_write explain apache#5443 * [Feature] [File Connector]fix code style apache#5443 * Update docs/en/connector-v2/sink/LocalFile.md * Update docs/en/connector-v2/sink/LocalFile.md * [Feature] [File Connector]fix code style apache#5443 * [Feature] [File Connector]add junit test apache#5443 * [Feature] [File Connector]add license header: apache#5443 * [Feature] [File Connector] Supports writing column names when the output type is file (CSV) apache#5443 * [Feature] [File Connector] fix code style and lineSeparator apache#5443 * [Feature] [File Connector] add enable_header_write,false:dont write header,true:write header. apache#5443 * [Feature] [File Connector] fix code style apache#5443 * [Feature] [File Connector] add enable_header_write explain apache#5443 * [Feature] [File Connector]fix code style apache#5443 * Update docs/en/connector-v2/sink/LocalFile.md * Update docs/en/connector-v2/sink/LocalFile.md * [Feature] [File Connector]fix code style apache#5443 * [Feature] [File Connector]add junit test apache#5443 * [Feature] [File Connector]add license header: apache#5443 * [Feature] [File Connector]add junit: apache#5443 * [Feature] [File Connector]add junit: apache#5443 * [Feature] [File Connector]remove scala: apache#5443 * [Feature] [File Connector]modify md style: apache#5443 * [Feature] [File Connector] Supports writing column names when the output type is file (CSV) apache#5443 * [Feature] [File Connector] fix code style and lineSeparator apache#5443 * [Feature] [File Connector] add enable_header_write,false:dont write header,true:write header. apache#5443 * [Feature] [File Connector] fix code style apache#5443 * [Feature] [File Connector] add enable_header_write explain apache#5443 * [Feature] [File Connector]fix code style apache#5443 * Update docs/en/connector-v2/sink/LocalFile.md * Update docs/en/connector-v2/sink/LocalFile.md * [Feature] [File Connector]fix code style apache#5443 * [Feature] [File Connector]add junit test apache#5443 * [Feature] [File Connector]add license header: apache#5443 * [Feature] [File Connector]add junit: apache#5443 * [Feature] [File Connector]add junit: apache#5443 * [Feature] [File Connector]remove scala: apache#5443 * [Feature] [File Connector]modify md style: apache#5443 * [Feature] [File Connector]junit modify: apache#5443 --------- Co-authored-by: zck <573693104@qq.com> Co-authored-by: Eric <gaojun2048@gmail.com>
close #5443
Purpose of this pull request
Check list
New License Guide
release-note
.