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

feat: support copy from xml. #8404

Merged
merged 23 commits into from
Nov 3, 2022

Conversation

eliasyaoyc
Copy link
Contributor

Signed-off-by: Elias.Yao siran0611@gmail.com

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

my implementation references mysql, and test complele stream load and copy stage
format1:

<row column1="value1" column2="value2" .../>

format2:

<row>
  <column1>value1</column1>
  <column2>value2</column2>
</row>

format3:

<row>
  <field name='column1'>value1</field>
  <field name='column2'>value2</field>
</row>

finally, line 119 in input_context.rs, would it be better to have then as arguments to the input_context.

Signed-off-by: Elias.Yao <siran0611@gmail.com>
@vercel
Copy link

vercel bot commented Oct 22, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
databend ⬜️ Ignored (Inspect) Nov 3, 2022 at 2:17AM (UTC)

@mergify mergify bot added the pr-feature this PR introduces a new feature to the codebase label Oct 22, 2022
Signed-off-by: Elias.Yao <siran0611@gmail.com>
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
@drmingdrmer
Copy link
Member

Signed-off-by: Elias.Yao <siran0611@gmail.com>
Signed-off-by: Elias.Yao <siran0611@gmail.com>
@eliasyaoyc
Copy link
Contributor Author

eliasyaoyc commented Oct 24, 2022

<?xml version="1.0"?>

<data>
  <!-- row tag -->
  <row title="Transaction Processing" author="Jim Gray" date="1992"/>
</data>

<data>
  <row>
  <title>Readings in Database Systems</title>
  <author>Michael Stonebraker</author>
  <date>2004</date>
  </row>
</data>

<data>
  <row>
  <field name="title">aaaa</field>
  <field name="author">bbbb</field>
  <field name="date">2022</field>
  </row>
</data>

result:
image

@Xuanwo
Copy link
Member

Xuanwo commented Oct 27, 2022

@mergify update

@mergify
Copy link
Contributor

mergify bot commented Oct 27, 2022

update

✅ Branch has been successfully updated

Signed-off-by: Elias.Yao <siran0611@gmail.com>
@Xuanwo
Copy link
Member

Xuanwo commented Oct 27, 2022

Please add a stateful test case to make sure we can load data from XML correctly~

@youngsofun
Copy link
Member

youngsofun commented Oct 27, 2022

by the way, do you know any real life cases of loading from XML?

@Xuanwo
Copy link
Member

Xuanwo commented Oct 27, 2022

by the way, do you know any real life cases of loading from XML?

We can test against https://www.treasurydirect.gov/xml/

Docs here: https://community.snowflake.com/s/article/How-to-Easily-Load-XML-with-SQL-Pt-1#:~:text=LOADING%20XML%20DATA%20INTO%20SNOWFLAKE&text=Create%20a%20new%20table%20with,column%20of%20the%20new%20table.

@eliasyaoyc eliasyaoyc marked this pull request as draft October 27, 2022 08:22
Signed-off-by: Elias.Yao <siran0611@gmail.com>
Signed-off-by: Elias.Yao <siran0611@gmail.com>
…_buffer_size

Signed-off-by: Elias.Yao <siran0611@gmail.com>
@eliasyaoyc eliasyaoyc marked this pull request as ready for review October 28, 2022 14:48
@youngsofun
Copy link
Member

ontime.xml can be removed now.
and need resolve the conflicts.

Signed-off-by: Elias.Yao <siran0611@gmail.com>
Signed-off-by: Elias.Yao <siran0611@gmail.com>
Signed-off-by: Elias.Yao <siran0611@gmail.com>
Signed-off-by: Elias.Yao <siran0611@gmail.com>
Signed-off-by: Elias.Yao <siran0611@gmail.com>
Signed-off-by: Elias.Yao <siran0611@gmail.com>
@eliasyaoyc eliasyaoyc marked this pull request as ready for review November 2, 2022 09:08
@youngsofun
Copy link
Member

others LGTM

Signed-off-by: Elias.yao <siran0611@gmail.com>
Signed-off-by: Elias.Yao <siran0611@gmail.com>
Copy link
Member

@sundy-li sundy-li left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for your persistence and contribution.

@mergify mergify bot merged commit 41838a5 into databendlabs:main Nov 3, 2022
@Xuanwo
Copy link
Member

Xuanwo commented Nov 3, 2022

cc @soyeric128, we supports copy from xml format now!

@soyeric128
Copy link
Collaborator

cc @soyeric128, we supports copy from xml format now!

OK. Nice to see COPY INTO grows stronger, BTW.

@soyeric128
Copy link
Collaborator

Some quick questions about the file formats:

  • Does the streaming load API also support for xml ?
  • Does COPY INTO support for TSV files?

@Xuanwo
Copy link
Member

Xuanwo commented Nov 7, 2022

  • Does the streaming load API also support for XML ?

Y.

  • Does COPY INTO support for TSV files?

Y.

@soyeric128
Copy link
Collaborator

Does a single data file have a size limit when working with the streaming load API or COPY INTO command?

@Xuanwo
Copy link
Member

Xuanwo commented Nov 9, 2022

Does a single data file have a size limit when working with the streaming load API or COPY INTO command?

No such limit so far.


It's better to start a new discussion at https://github.com/datafuselabs/databend/discussions so that we are not disturbing subscribers of this PR 💌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants