Skip to content

[Outfile] Support exporting query result to local disk#5489

Merged
morningman merged 1 commit intoapache:masterfrom
morningman:outfile_bug
Mar 14, 2021
Merged

[Outfile] Support exporting query result to local disk#5489
morningman merged 1 commit intoapache:masterfrom
morningman:outfile_bug

Conversation

@morningman
Copy link
Contributor

@morningman morningman commented Mar 9, 2021

Proposed changes

User can export query result to local disk like:

select * from tbl into outfile ("file:///disk1/result_");

And modify the return result to show the details of export:

mysql> select * from tbl1 limit 10 into outfile "file:///home/work/path/result_";
+------------+-----------+----------+--------------+
| FileNumber | TotalRows | FileSize | URL          |
+------------+-----------+----------+--------------+
|          1 |         2 |        8 | 192.168.1.10 |
+------------+-----------+----------+--------------+

Support create a mark file after export successfully finished.

Types of changes

  • New feature (non-breaking change which adds functionality)
  • Code refactor (Modify the code structure, format the code, etc...)

Checklist

@morningman morningman added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API api-review Categorizes an issue or PR as actively needing an API review. labels Mar 9, 2021
@morningman morningman self-assigned this Mar 9, 2021
@morningman morningman added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 9, 2021
yangzhg
yangzhg previously approved these changes Mar 10, 2021
Copy link
Member

@yangzhg yangzhg 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 11, 2021
1.
User can export query result to local disk like:

`select * from tbl into outfile ("file:///disk1/result_");`

And modify the return result to show the details of export:

```
mysql> select * from tbl1 limit 10 into outfile "file:///home/work/path/result_";
+------------+-----------+----------+--------------+
| FileNumber | TotalRows | FileSize | URL          |
+------------+-----------+----------+--------------+
|          1 |         2 |        8 | 192.168.1.10 |
+------------+-----------+----------+--------------+
```

2.
Support create a mark file after export successfully finished.
Copy link
Member

@yangzhg yangzhg 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 merged commit 4b316e4 into apache:master Mar 14, 2021
@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. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Outfile] Support export query result to local disk

3 participants