|
7 | 7 | import com.xxdb.multithreadedtablewriter.MultithreadedTableWriter;
|
8 | 8 | import com.xxdb.route.AutoFitTableAppender;
|
9 | 9 | import com.xxdb.route.AutoFitTableUpsert;
|
| 10 | +import com.xxdb.route.PartitionedTableAppender; |
10 | 11 | import junit.framework.Assert;
|
11 | 12 | import org.junit.After;
|
12 | 13 | import org.junit.Before;
|
@@ -7731,5 +7732,49 @@ public void test_MultithreadedTableWriter_allDataType_array_null() throws Except
|
7731 | 7732 | // System.out.println(writedData2);
|
7732 | 7733 | // }
|
7733 | 7734 |
|
| 7735 | +// @Test not support |
| 7736 | +// public void Test_MultithreadedTableWriter_iotAnyVector() throws Exception { |
| 7737 | +// String script = "if(existsDatabase(\"dfs://testIOT_allDateType\")) dropDatabase(\"dfs://testIOT_allDateType\")\n" + |
| 7738 | +// " create database \"dfs://testIOT_allDateType\" partitioned by VALUE(1..20),RANGE(2020.01.01 2022.01.01 2025.01.01), engine='TSDB'\n" + |
| 7739 | +// " create table \"dfs://testIOT_allDateType\".\"pt\"(\n" + |
| 7740 | +// " deviceId INT,\n" + |
| 7741 | +// " timestamp TIMESTAMP,\n" + |
| 7742 | +// " location SYMBOL,\n" + |
| 7743 | +// " value IOTANY,\n" + |
| 7744 | +// " )\n" + |
| 7745 | +// "partitioned by deviceId, timestamp,\n" + |
| 7746 | +// "sortColumns=[`deviceId, `location, `timestamp],\n" + |
| 7747 | +// "latestKeyCache=true;\n" + |
| 7748 | +// "pt = loadTable(\"dfs://testIOT_allDateType\",\"pt\");\n" ; |
| 7749 | +// conn.run(script); |
| 7750 | +// BasicTable bt = (BasicTable)conn.run("t=table([1] as deviceId, [now()] as timestamp, [`loc1] as location, [char('Q')] as value);\n select * from t"); |
| 7751 | +// BasicTable bt1 = (BasicTable)conn.run("t=table([2] as deviceId, [now()] as timestamp, [`loc1] as location, [short(233)] as value);\n select * from t"); |
| 7752 | +// BasicTable bt2 = (BasicTable)conn.run("t=table([3] as deviceId, [now()] as timestamp, [`loc1] as location, [int(-233)] as value);\n select * from t"); |
| 7753 | +// BasicTable bt3 = (BasicTable)conn.run("t=table([4] as deviceId, [now()] as timestamp, [`loc1] as location, [long(233121)] as value);\n select * from t"); |
| 7754 | +// BasicTable bt4 = (BasicTable)conn.run("t=table([5] as deviceId, [now()] as timestamp, [`loc1] as location, [true] as value);\n select * from t"); |
| 7755 | +// BasicTable bt5 = (BasicTable)conn.run("t=table([6] as deviceId, [now()] as timestamp, [`loc1] as location, [233.34f] as value);\n select * from t"); |
| 7756 | +// BasicTable bt6 = (BasicTable)conn.run("t=table([7] as deviceId, [now()] as timestamp, [`loc1] as location, [233.34] as value);\n select * from t"); |
| 7757 | +// BasicTable bt7 = (BasicTable)conn.run("t=table([8] as deviceId, [now()] as timestamp, [`loc1] as location, [`loc1] as value);\n select * from t"); |
| 7758 | +// BasicTable bt8 = (BasicTable)conn.run("t=table(12..14 as deviceId, [now(),2022.06.13 13:30:10.008,2020.06.13 13:30:10.008] as timestamp, [`loc1`loc2`loc3] as location, [symbol(`AAA`bbb`xxx)] as value);\n select * from t limit 1"); |
| 7759 | +// System.out.println(bt8.getString()); |
| 7760 | +// |
| 7761 | +// mutithreadTableWriter_ = new MultithreadedTableWriter(HOST, PORT, "admin", "123456", "dfs://testIOT_allDateType", "pt", false, false, null, 1, 1, 1, "deviceId"); |
| 7762 | +// ErrorCodeInfo pErrorInfo = mutithreadTableWriter_.insert( 1,System.currentTimeMillis(),"loc1",(byte)1); |
| 7763 | +// ErrorCodeInfo pErrorInfo1 = mutithreadTableWriter_.insert( 2,System.currentTimeMillis(),"loc1",(short) 0); |
| 7764 | +// ErrorCodeInfo pErrorInfo2 = mutithreadTableWriter_.insert( 3,System.currentTimeMillis(),"loc1",(int)-233); |
| 7765 | +// ErrorCodeInfo pErrorInfo3 = mutithreadTableWriter_.insert( 4,System.currentTimeMillis(),"loc1",(long)-233); |
| 7766 | +// ErrorCodeInfo pErrorInfo4 = mutithreadTableWriter_.insert( 5,System.currentTimeMillis(),"loc1",true); |
| 7767 | +// ErrorCodeInfo pErrorInfo5 = mutithreadTableWriter_.insert( 6,System.currentTimeMillis(),"loc1",233.34f); |
| 7768 | +// ErrorCodeInfo pErrorInfo6 = mutithreadTableWriter_.insert( 7,System.currentTimeMillis(),"loc1",-233.34); |
| 7769 | +// ErrorCodeInfo pErrorInfo7 = mutithreadTableWriter_.insert( 8,System.currentTimeMillis(),"loc1","loc1"); |
| 7770 | +// List<String> list = new ArrayList<>(); |
| 7771 | +// list.add(null); |
| 7772 | +// list.add("OceanBase"); |
| 7773 | +// BasicSymbolVector bsymbolv = new BasicSymbolVector(list); |
| 7774 | +// ErrorCodeInfo pErrorInfo8 = mutithreadTableWriter_.insert(new BasicIntVector( new int[]{9,10}),new BasicTimestampVector(Arrays.asList(new Long[]{Long.valueOf(9), Long.valueOf(10)})),new BasicStringVector(new String[]{"GOOG","MS"}),bsymbolv); |
| 7775 | +// BasicTable bt10 = (BasicTable) conn.run("select * from loadTable(\"dfs://testIOT_allDateType\",`pt);"); |
| 7776 | +// //assertEquals(11, bt10.rows()); |
| 7777 | +// System.out.println(bt10.getString()); |
| 7778 | +// } |
7734 | 7779 | }
|
7735 | 7780 |
|
0 commit comments