Skip to content

Commit

Permalink
test(xml): update xml tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
youngsofun committed Nov 14, 2022
1 parent 886f0cc commit 3438374
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 31 deletions.
26 changes: 13 additions & 13 deletions tests/suites/1_stateful/05_formats/05_03_xml/05_03_01_xml_v1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ cat << EOF > /tmp/simple_v1.xml
<data>
<row>
<id>1</id>
<name>shuai\"ge</name>
<data>{\"我是\":\"帅哥\"}</data>
<name>shuai"ge</name>
<data>{"我是":"帅哥"}</data>
<create_time>2022-11-01 10:51:14</create_time>
</row>
<row>
<id>2</id>
<name>\"mengnan\"</name>
<data>\"猛\"男</data>
<name>"mengnan"</name>
<data>"猛"男</data>
<create_time>2022-11-01 10:51:14</create_time>
</row>
<row>
<ID>3</ID>
<NAME>\"mengnan\"</NAME>
<DATA>\"猛\"男</DATA>
<NAME>"mengnan"</NAME>
<DATA>"猛"男</DATA>
<CREATE_TIME>2022-11-01 10:51:14</CREATE_TIME>
<EMPTY>123</EMPTY>
</row>
Expand All @@ -44,27 +44,27 @@ cat << EOF > /tmp/simple_v2.xml
<data>
<databend>
<id>1</id>
<name>shuai\"ge</name>
<data>{\"我是\":\"帅哥\"}</data>
<name>shuai"ge</name>
<data>{"我是":"帅哥"}</data>
<create_time>2022-11-01 10:51:14</create_time>
</databend>
<databend>
<id>2</id>
<name>\"mengnan\"</name>
<data>\"猛\"男</data>
<name>"mengnan"</name>
<data>"猛"男</data>
<create_time>2022-11-01 10:51:14</create_time>
</databend>
<databend>
<ID>3</ID>
<NAME>\"mengnan\"</NAME>
<DATA>\"猛\"男</DATA>
<NAME>"mengnan"</NAME>
<DATA>"猛"男</DATA>
<CREATE_TIME>2022-11-01 10:51:14</CREATE_TIME>
<EMPTY>123</EMPTY>
</databend>
</data>
EOF

curl -sH "insert_sql:insert into test_xml format XML" -F "upload=@/tmp/simple_v1.xml" -u root: -XPUT "http://localhost:${QUERY_HTTP_HANDLER_PORT}/v1/streaming_load" | grep -c "SUCCESS"
curl -sH "insert_sql:insert into test_xml format XML" -F "upload=@/tmp/simple_v1.xml" -u root: -XPUT "http://localhost:${QUERY_HTTP_HANDLER_PORT}/v1/streaming_load" | grep -c "SUCCESS"
echo "select * from test_xml" | $MYSQL_CLIENT_CONNECT
echo "truncate table test_xml" | $MYSQL_CLIENT_CONNECT

Expand Down
12 changes: 6 additions & 6 deletions tests/suites/1_stateful/05_formats/05_03_xml/05_03_02_xml_v2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ echo "CREATE TABLE test_xml (
cat << EOF > /tmp/simple_v2.xml
<?xml version="1.0"?>
<data>
<row id="1" name='shuai\"ge' data='{\"我是\":\"帅哥\"}' create_time="2022-11-01 10:51:14"/>
<row id="2" name='\"mengnan\"' data='\"猛\"男' create_time="2022-11-01 10:51:14"/>
<row ID="3" NAME='\"mengnan\"' DATA='\"猛\"男' CREATE_TIME="2022-11-01 10:51:14" EMPTY="123"/>
<row id="1" name='shuai"ge' data='{"我是":"帅哥"}' create_time="2022-11-01 10:51:14"/>
<row id="2" name='"mengnan"' data='"猛"男' create_time="2022-11-01 10:51:14"/>
<row ID="3" NAME='"mengnan"' DATA='"猛"男' CREATE_TIME="2022-11-01 10:51:14" EMPTY="123"/>
</data>
EOF

# custom row_tag
cat << EOF > /tmp/simple_v3.xml
<?xml version="1.0"?>
<data>
<databend id="1" name='shuai\"ge' data='{\"我是\":\"帅哥\"}' create_time="2022-11-01 10:51:14"/>
<databend id="2" name='\"mengnan\"' data='\"猛\"男' create_time="2022-11-01 10:51:14"/>
<databend ID="3" NAME='\"mengnan\"' DATA='\"猛\"男' CREATE_TIME="2022-11-01 10:51:14" EMPTY="123"/>
<databend id="1" name='shuai"ge' data='{"我是":"帅哥"}' create_time="2022-11-01 10:51:14"/>
<databend id="2" name='"mengnan"' data='"猛"男' create_time="2022-11-01 10:51:14"/>
<databend ID="3" NAME='"mengnan"' DATA='"猛"男' CREATE_TIME="2022-11-01 10:51:14" EMPTY="123"/>
</data>
EOF

Expand Down
24 changes: 12 additions & 12 deletions tests/suites/1_stateful/05_formats/05_03_xml/05_03_03_xml_v3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ cat << EOF > /tmp/simple_v3.xml
<data>
<row>
<field name="id">1</field>
<field name="name">shuai\"ge</field>
<field name="data">{\"我是\":\"帅哥\"}</field>
<field name="name">shuai"ge</field>
<field name="data">{"我是":"帅哥"}</field>
<field name="create_time">2022-11-01 10:51:14</field>
</row>
<row>
<field name="id">2</field>
<field name="name">\"mengnan\"</field>
<field name="data">\"猛\"男</field>
<field name="name">"mengnan"</field>
<field name="data">"猛"男</field>
<field name="create_time">2022-11-01 10:51:14</field>
</row>
<row>
<field name="ID">3</field>
<field name="NAME">\"mengnan\"</field>
<field name="DATA">\"猛\"男</field>
<field name="NAME">"mengnan"</field>
<field name="DATA">"猛"男</field>
<field name="CREATE_TIME">2022-11-01 10:51:14</field>
<field name="EMPTY">123</field>
</row>
Expand All @@ -34,20 +34,20 @@ cat << EOF > /tmp/simple_v4.xml
<data>
<databend>
<field name="id">1</field>
<field name="name">shuai\"ge</field>
<field name="data">{\"我是\":\"帅哥\"}</field>
<field name="name">shuai"ge</field>
<field name="data">{"我是":"帅哥"}</field>
<field name="create_time">2022-11-01 10:51:14</field>
</databend>
<databend>
<field name="id">2</field>
<field name="name">\"mengnan\"</field>
<field name="data">\"猛\"男</field>
<field name="name">"mengnan"</field>
<field name="data">"猛"男</field>
<field name="create_time">2022-11-01 10:51:14</field>
</databend>
<databend>
<field name="ID">3</field>
<field name="NAME">\"mengnan\"</field>
<field name="DATA">\"猛\"男</field>
<field name="NAME">"mengnan"</field>
<field name="DATA">"猛"男</field>
<field name="CREATE_TIME">2022-11-01 10:51:14</field>
<field name="EMPTY">123</field>
</databend>
Expand Down

0 comments on commit 3438374

Please sign in to comment.