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

[Export] Expand function of export stmt #5445

Merged
merged 4 commits into from
Mar 11, 2021
Merged

Conversation

EmmyMiao87
Copy link
Contributor

@EmmyMiao87 EmmyMiao87 commented Mar 3, 2021

Proposed changes

  1. Support where clause in export stmt which only export selected rows.

The syntax is following:

Export table [table name]
where [expr]
To xxx
xxxx

It will filter table rows.
Only rows that meet the where condition can be exported.

  1. Support utf8 separator

  2. Support export to local

The syntax is following:

Export table [table name]
To (file:///xxx/xx/xx)

If user export rows to local, the broker properties is not requried.
User only need to create a local folder to store data, and fill in the path of the folder starting with file://

Change-Id: Ib7e7ece5accb3e359a67310b0bf006d42cd3f6f5

Types of changes

What types of changes does your code introduce to Doris?
Put an x in the boxes that apply

  • [] Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • [] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [] Documentation Update (if none of the other choices apply)
  • [] Code refactor (Modify the code structure, format the code, etc...)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have created an issue on (Fix Extended export function #5446) and described the bug/feature there in detail
  • [] Compiling and unit tests pass locally with my changes
  • [] I have added tests that prove my fix is effective or that my feature works
  • If these changes need document changes, I have updated the document
  • [] Any dependent changes have been merged

@EmmyMiao87 EmmyMiao87 added area/backup Issues of PRS related to backup and restore api-review Categorizes an issue or PR as actively needing an API review. kind/improvement labels Mar 3, 2021
@EmmyMiao87
Copy link
Contributor Author

I will update document later.

@EmmyMiao87
Copy link
Contributor Author

I will update document later.

Done

miaoling01 and others added 3 commits March 9, 2021 14:50
1. Support where clause in export stmt which only export selected rows.

The syntax is following:

Export table [table name]
    where [expr]
To xxx
xxxx

It will filter table rows.
Only rows that meet the where condition can be exported.

2. Support utf8 separator

3. Support export to local

The syntax is following:

Export table [table name]
To (file:///xxx/xx/xx)

If user export rows to local, the broker properties is not requried.
User only need to create a local folder to store data, and fill in the path of the folder starting with file://

Change-Id: Ib7e7ece5accb3e359a67310b0bf006d42cd3f6f5
@@ -46,6 +46,8 @@
import java.util.List;
import java.util.Map;

import static org.apache.doris.analysis.OutFileClause.LOCAL_FILE_PREFIX;
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't using static import

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok

@@ -89,6 +99,8 @@
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;

import static org.apache.doris.analysis.OutFileClause.LOCAL_FILE_PREFIX;
Copy link
Contributor

Choose a reason for hiding this comment

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

static import

Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

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

LGTM

@morningman morningman added the approved Indicates a PR has been approved by one committer. label Mar 9, 2021
@morningman morningman self-assigned this Mar 9, 2021
@EmmyMiao87 EmmyMiao87 merged commit 6cbbc36 into apache:master Mar 11, 2021
EmmyMiao87 added a commit to EmmyMiao87/incubator-doris that referenced this pull request Apr 21, 2021
1. Support where clause in export stmt which only export selected rows.

The syntax is following:

Export table [table name]
    where [expr]
To xxx
xxxx

It will filter table rows.
Only rows that meet the where condition can be exported.

2. Support utf8 separator

3. Support export to local

The syntax is following:

Export table [table name]
To (file:///xxx/xx/xx)

If user export rows to local, the broker properties is not requried.
User only need to create a local folder to store data, and fill in the path of the folder starting with file://

Change-Id: Ib7e7ece5accb3e359a67310b0bf006d42cd3f6f5
@morningman morningman mentioned this pull request Oct 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review Categorizes an issue or PR as actively needing an API review. approved Indicates a PR has been approved by one committer. area/backup Issues of PRS related to backup and restore kind/improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extended export function
2 participants