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

Add LOAD INTO VALUES #11633

Merged
merged 5 commits into from
Sep 6, 2023
Merged

Add LOAD INTO VALUES #11633

merged 5 commits into from
Sep 6, 2023

Conversation

nnsgmsone
Copy link
Contributor

@nnsgmsone nnsgmsone commented Sep 5, 2023

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #9955

What this PR does / why we need it:

Provide a quick way to insert data, example is as follows:

load data  inline format='csv', data='1\n2\n' into table t1;

load data  inline format='csv', data=$XXX$
1
2
$XXX$ 
into table t1;

@matrix-meow matrix-meow added the size/XXL Denotes a PR that changes 2000+ lines label Sep 5, 2023
@mergify mergify bot added the kind/feature label Sep 5, 2023
Copy link
Contributor

@fengttt fengttt left a comment

Choose a reason for hiding this comment

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

Need more tests.

Esp data with ' in it. Make sure quote works. Make sure $XXX$ syntax works.

$XXX$ 
one line
another line
$XXX$ 

@nnsgmsone
Copy link
Contributor Author

nnsgmsone commented Sep 5, 2023

Need more tests.

Esp data with ' in it. Make sure quote works. Make sure $XXX$ syntax works.

$XXX$ 
one line
another line
$XXX$ 

$xxx$是什么意思呢?是下面这个行为吗。。

mysql>  load data  inline format='csv', data='"1"\n"2"\n$XXX$' into table t1;
Query OK, 3 rows affected (0.01 sec)

mysql> select * from t1;
+-------+
| a     |
+-------+
| 1     |
| 2     |
| $XXX$ |
+-------+
3 rows in set (0.01 sec)

@fengttt

@nnsgmsone
Copy link
Contributor Author

nnsgmsone commented Sep 5, 2023

逻辑上load data inline format='csv', data='1\n2\n' into table t1中的data必须是一个满足mysql定义的字符串。就是词法解析阶段定义的一个string @fengttt

@fengttt
Copy link
Contributor

fengttt commented Sep 5, 2023

load data  inline format='csv', data=$XXX$
1
2
$XXX$ 
into table t1;

@nnsgmsone
Copy link
Contributor Author

nnsgmsone commented Sep 5, 2023

没有'吗。。不是下面这样吗?

load data  inline format='csv', data='$XXX$
1
2
$XXX$' 
into table t1;

@fengttt 如果没有'的话,那个可能没那么简单处理,有的话,现在就支持的,我多加一些test case即可。。

@nnsgmsone nnsgmsone requested a review from fengttt September 6, 2023 01:20
@mergify mergify bot merged commit 1d83b77 into matrixorigin:main Sep 6, 2023
sukki37 pushed a commit that referenced this pull request Sep 17, 2023
Provide a quick way to insert data,  example is as follows:
```sql
load data  inline format='csv', data='1\n2\n' into table t1;

load data  inline format='csv', data=$XXX$
1
2
$XXX$
into table t1;
```

Approved by: @ouyuanning, @iamlinjunhong, @m-schen, @aunjgr, @heni02, @fengttt
sukki37 pushed a commit that referenced this pull request Sep 17, 2023
Provide a quick way to insert data,  example is as follows:
```sql
load data  inline format='csv', data='1\n2\n' into table t1;

load data  inline format='csv', data=$XXX$
1
2
$XXX$
into table t1;
```

Approved by: @ouyuanning, @iamlinjunhong, @m-schen, @aunjgr, @heni02, @fengttt
sukki37 pushed a commit that referenced this pull request Sep 18, 2023
Provide a quick way to insert data,  example is as follows:
```sql
load data  inline format='csv', data='1\n2\n' into table t1;

load data  inline format='csv', data=$XXX$
1
2
$XXX$
into table t1;
```

Approved by: @ouyuanning, @iamlinjunhong, @m-schen, @aunjgr, @heni02, @fengttt
@nnsgmsone nnsgmsone deleted the insert branch October 10, 2023 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature size/XXL Denotes a PR that changes 2000+ lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants