@@ -50,7 +50,7 @@ public void test_BasicIotAnyVector_Scalar() throws IOException {
5050 Scalar [] scalar1 = new Scalar []{new BasicString ( "qqa123" ),new BasicString ( "最新字符qqa" )};
5151 BasicIotAnyVector BIV1 = new BasicIotAnyVector (scalar1 );
5252 Assert .assertEquals ("[qqa123,最新字符qqa]" ,BIV1 .getString ());
53- System .out .println (BIV1 .getString (2 ));
53+ System .out .println (BIV1 .getString (1 ));
5454 Scalar [] scalar2 = new Scalar [100000 ];
5555 for (int i =0 ;i <scalar2 .length ;i ++){
5656 scalar2 [i ] = scalar [i % scalar .length ];
@@ -147,9 +147,9 @@ public void test_BasicIotAnyVector_Scalar_null() throws IOException {
147147
148148 @ Test
149149 public void test_BasicIotAnyVector_2 () throws IOException {
150- String script = "if(existsDatabase(\" dfs://testIOT \" )) dropDatabase(\" dfs://testIOT \" )\n " +
151- " create database \" dfs://testIOT \" partitioned by HASH([INT, 40]),RANGE(2020.01.01 2022.01.01 2025.01.01), engine='TSDB'\n " +
152- " create table \" dfs://testIOT \" .\" pt\" (\n " +
150+ String script = "if(existsDatabase(\" dfs://testIOT222 \" )) dropDatabase(\" dfs://testIOT222 \" )\n " +
151+ " create database \" dfs://testIOT222 \" partitioned by HASH([INT, 40]),RANGE(2020.01.01 2022.01.01 2025.01.01), engine='TSDB'\n " +
152+ " create table \" dfs://testIOT222 \" .\" pt\" (\n " +
153153 " deviceId INT,\n " +
154154 " timestamp TIMESTAMP,\n " +
155155 " location SYMBOL,\n " +
@@ -158,14 +158,14 @@ public void test_BasicIotAnyVector_2() throws IOException {
158158 "partitioned by deviceId, timestamp,\n " +
159159 "sortColumns=[`deviceId, `location, `timestamp],\n " +
160160 "latestKeyCache=true;\n " +
161- "pt = loadTable(\" dfs://testIOT \" ,\" pt\" );\n " +
161+ "pt = loadTable(\" dfs://testIOT222 \" ,\" pt\" );\n " +
162162 "t = table([1] as deviceId,\n " +
163163 " [now()] as timestamp,\n " +
164164 " [`loc1] as location,\n " +
165165 " [long(233)] as value)\n " +
166166 "pt.append!(t)" ;
167167 conn .run (script );
168- BasicTable entity1 = (BasicTable )conn .run ("select * from loadTable( \" dfs://testIOT \" , `pt) ;" );
168+ BasicTable entity1 = (BasicTable )conn .run ("select * from loadTable( \" dfs://testIOT222 \" , `pt) ;" );
169169 System .out .println (entity1 .getString ());
170170 BasicIotAnyVector BIV = (BasicIotAnyVector )entity1 .getColumn ("value" );
171171 Assert .assertEquals (Entity .DATA_CATEGORY .MIXED ,BIV .getDataCategory ());
@@ -270,11 +270,11 @@ public void test_iotAnyVector_combine() throws IOException {
270270 BIV .combine (new BasicIntVector (2 ));
271271 }
272272
273- @ Test //有问题
273+ @ Test
274274 public void test_iotAnyVector_bigData () throws IOException {
275- String script = "if(existsDatabase(\" dfs://testIOT \" )) dropDatabase(\" dfs://testIOT \" )\n " +
276- " create database \" dfs://testIOT \" partitioned by HASH([INT, 40]),RANGE(2020.01.01 2022.01.01 2025.01.01), engine='TSDB'\n " +
277- " create table \" dfs://testIOT \" .\" pt\" (\n " +
275+ String script = "if(existsDatabase(\" dfs://testIOT123 \" )) dropDatabase(\" dfs://testIOT123 \" )\n " +
276+ " create database \" dfs://testIOT123 \" partitioned by HASH([INT, 40]),RANGE(2020.01.01 2022.01.01 2025.01.01), engine='TSDB'\n " +
277+ " create table \" dfs://testIOT123 \" .\" pt\" (\n " +
278278 " deviceId INT,\n " +
279279 " timestamp TIMESTAMP,\n " +
280280 " location SYMBOL,\n " +
@@ -283,26 +283,26 @@ public void test_iotAnyVector_bigData() throws IOException {
283283 "partitioned by deviceId, timestamp,\n " +
284284 "sortColumns=[`deviceId, `location, `timestamp],\n " +
285285 "latestKeyCache=true;\n " +
286- "pt = loadTable(\" dfs://testIOT \" ,\" pt\" );\n " +
286+ "pt = loadTable(\" dfs://testIOT123 \" ,\" pt\" );\n " +
287287 "t=table(take(1..100000,100000) as deviceId, take(now()+(0..100), 100000) as timestamp, take(\" bb\" +string(0..100), 100000) as location, take(int(1..100000),100000) as value)\n " +
288288 "pt.append!(t)\n " +
289289 "flushTSDBCache()\n " +
290290 "t=table(take(100001..200000,100000) as deviceId, take(now()+(0..100), 100000) as timestamp,take(lpad(string(1), 8, \" 0\" ), 100000) as location, rand(200.0, 100000) as value)\n " +
291291 "pt.append!(t)\n " +
292292 "flushTSDBCache()\n " ;
293293 conn .run (script );
294- BasicTable entity1 = (BasicTable )conn .run ("select value from loadTable( \" dfs://testIOT \" , `pt) order by timestamp;" );
295- System .out .println (entity1 .getString ());
294+ BasicTable entity1 = (BasicTable )conn .run ("select * from loadTable( \" dfs://testIOT123 \" , `pt) order by timestamp;" );
295+ // System.out.println(entity1.getColumn(3) .getString());
296296 Assert .assertEquals (200000 ,entity1 .rows ());
297- BasicIotAnyVector BIV = (BasicIotAnyVector ) entity1 . getColumn ( "value " );
298- System . out . println ( BIV .getString ());
297+ BasicTable entity2 = (BasicTable ) conn . run ( "select * from loadTable( \" dfs://testIOT123 \" , `pt) where deviceId in 1..100000 order by timestamp " );
298+ Assert . assertEquals ( entity2 . getColumn ( 0 ). getString (), entity2 . getColumn ( 0 ) .getString ());
299299 }
300300
301301 @ Test
302302 public void test_iotAnyVector_allDateType () throws IOException {
303- String script = "if(existsDatabase(\" dfs://testIOT3 \" )) dropDatabase(\" dfs://testIOT3 \" )\n " +
304- " create database \" dfs://testIOT3 \" partitioned by VALUE(1..20),RANGE(2020.01.01 2022.01.01 2025.01.01), engine='TSDB'\n " +
305- " create table \" dfs://testIOT3 \" .\" pt\" (\n " +
303+ String script = "if(existsDatabase(\" dfs://testIOT333 \" )) dropDatabase(\" dfs://testIOT333 \" )\n " +
304+ " create database \" dfs://testIOT333 \" partitioned by VALUE(1..20),RANGE(2020.01.01 2022.01.01 2025.01.01), engine='TSDB'\n " +
305+ " create table \" dfs://testIOT333 \" .\" pt\" (\n " +
306306 " deviceId INT,\n " +
307307 " timestamp TIMESTAMP,\n " +
308308 " location SYMBOL,\n " +
@@ -311,7 +311,7 @@ public void test_iotAnyVector_allDateType() throws IOException {
311311 "partitioned by deviceId, timestamp,\n " +
312312 "sortColumns=[`deviceId, `location, `timestamp],\n " +
313313 "latestKeyCache=true;\n " +
314- "pt = loadTable(\" dfs://testIOT3 \" ,\" pt\" );\n " +
314+ "pt = loadTable(\" dfs://testIOT333 \" ,\" pt\" );\n " +
315315 "t=table([1] as deviceId, [now()] as timestamp, [`loc1] as location, [char('Q')] as value)\n " +
316316 "pt.append!(t)\n " +
317317 "flushTSDBCache()\n " +
@@ -340,9 +340,9 @@ public void test_iotAnyVector_allDateType() throws IOException {
340340 "pt.append!(t)\n " +
341341 "flushTSDBCache()\n " ;
342342 conn .run (script );
343- BasicTable entity1 = (BasicTable )conn .run ("select * from loadTable( \" dfs://testIOT3 \" , `pt) order by deviceId;" );
343+ BasicTable entity1 = (BasicTable )conn .run ("select * from loadTable( \" dfs://testIOT333 \" , `pt) order by deviceId;" );
344344 Assert .assertEquals ("['Q',233,-233,233121,true,233.33999634,233.34,loc1,AAA,bbb,xxx]" , entity1 .getColumn ("value" ).getString ());
345- BasicIotAnyVector entity2 = (BasicIotAnyVector )conn .run (" exec value from loadTable( \" dfs://testIOT3 \" , `pt) order by deviceId;" );
345+ BasicIotAnyVector entity2 = (BasicIotAnyVector )conn .run (" exee= exec value from loadTable( \" dfs://testIOT333 \" , `pt) order by deviceId;exee " );
346346 Assert .assertEquals ("['Q',233,-233,233121,true,233.33999634,233.34,loc1,AAA,bbb,xxx]" , entity2 .getString ());
347347 BasicIotAnyVector BIV = (BasicIotAnyVector )entity1 .getColumn ("value" );
348348 Assert .assertEquals ("['Q',233,-233,233121,true,233.33999634,233.34,loc1,AAA,bbb,xxx]" , BIV .getString ());
@@ -372,9 +372,9 @@ public void test_iotAnyVector_allDateType() throws IOException {
372372
373373 @ Test
374374 public void test_iotAnyVector_allDateType_null () throws IOException {
375- String script = "if(existsDatabase(\" dfs://testIOT3 \" )) dropDatabase(\" dfs://testIOT3 \" )\n " +
376- " create database \" dfs://testIOT3 \" partitioned by VALUE(1..20),RANGE(2020.01.01 2022.01.01 2025.01.01), engine='TSDB'\n " +
377- " create table \" dfs://testIOT3 \" .\" pt\" (\n " +
375+ String script = "if(existsDatabase(\" dfs://testIOT333 \" )) dropDatabase(\" dfs://testIOT333 \" )\n " +
376+ " create database \" dfs://testIOT333 \" partitioned by VALUE(1..20),RANGE(2020.01.01 2022.01.01 2025.01.01), engine='TSDB'\n " +
377+ " create table \" dfs://testIOT333 \" .\" pt\" (\n " +
378378 " deviceId INT,\n " +
379379 " timestamp TIMESTAMP,\n " +
380380 " location SYMBOL,\n " +
@@ -383,7 +383,7 @@ public void test_iotAnyVector_allDateType_null() throws IOException {
383383 "partitioned by deviceId, timestamp,\n " +
384384 "sortColumns=[`deviceId, `location, `timestamp],\n " +
385385 "latestKeyCache=true;\n " +
386- "pt = loadTable(\" dfs://testIOT3 \" ,\" pt\" );\n " +
386+ "pt = loadTable(\" dfs://testIOT333 \" ,\" pt\" );\n " +
387387 "t=table([1] as deviceId, [now()] as timestamp, [`loc1] as location, [char(NULL)] as value)\n " +
388388 "pt.append!(t)\n " +
389389 "flushTSDBCache()\n " +
@@ -412,9 +412,9 @@ public void test_iotAnyVector_allDateType_null() throws IOException {
412412 "pt.append!(t)\n " +
413413 "flushTSDBCache()\n " ;
414414 conn .run (script );
415- BasicTable entity1 = (BasicTable )conn .run ("select * from loadTable( \" dfs://testIOT3 \" , `pt) order by deviceId;" );
415+ BasicTable entity1 = (BasicTable )conn .run ("select * from loadTable( \" dfs://testIOT333 \" , `pt) order by deviceId;" );
416416 Assert .assertEquals ("[,,,,,,,,AAA,AAA,]" , entity1 .getColumn ("value" ).getString ());
417- BasicIotAnyVector entity2 = (BasicIotAnyVector )conn .run (" exec value from loadTable( \" dfs://testIOT3 \" , `pt) order by deviceId;" );
417+ BasicIotAnyVector entity2 = (BasicIotAnyVector )conn .run (" exec value from loadTable( \" dfs://testIOT333 \" , `pt) order by deviceId;" );
418418 Assert .assertEquals ("[,,,,,,,,AAA,AAA,]" , entity2 .getString ());
419419 BasicIotAnyVector BIV = (BasicIotAnyVector )entity1 .getColumn ("value" );
420420 Assert .assertEquals ("[,,,,,,,,AAA,AAA,]" , BIV .getString ());
@@ -443,9 +443,9 @@ public void test_iotAnyVector_allDateType_null() throws IOException {
443443 }
444444 @ Test
445445 public void test_iotAnyVector_allDateType_upload () throws IOException {
446- String script = "if(existsDatabase(\" dfs://testIOT3 \" )) dropDatabase(\" dfs://testIOT3 \" )\n " +
447- " create database \" dfs://testIOT3 \" partitioned by VALUE(1..20),RANGE(2020.01.01 2022.01.01 2025.01.01), engine='TSDB'\n " +
448- " create table \" dfs://testIOT3 \" .\" pt\" (\n " +
446+ String script = "if(existsDatabase(\" dfs://testIOT333 \" )) dropDatabase(\" dfs://testIOT333 \" )\n " +
447+ " create database \" dfs://testIOT333 \" partitioned by VALUE(1..20),RANGE(2020.01.01 2022.01.01 2025.01.01), engine='TSDB'\n " +
448+ " create table \" dfs://testIOT333 \" .\" pt\" (\n " +
449449 " deviceId INT,\n " +
450450 " timestamp TIMESTAMP,\n " +
451451 " location SYMBOL,\n " +
@@ -454,7 +454,7 @@ public void test_iotAnyVector_allDateType_upload() throws IOException {
454454 "partitioned by deviceId, timestamp,\n " +
455455 "sortColumns=[`deviceId, `location, `timestamp],\n " +
456456 "latestKeyCache=true;\n " +
457- "pt = loadTable(\" dfs://testIOT3 \" ,\" pt\" );\n " +
457+ "pt = loadTable(\" dfs://testIOT333 \" ,\" pt\" );\n " +
458458 "t=table([1] as deviceId, [now()] as timestamp, [`loc1] as location, [char('Q')] as value)\n " +
459459 "pt.append!(t)\n " +
460460 "flushTSDBCache()\n " +
@@ -483,7 +483,7 @@ public void test_iotAnyVector_allDateType_upload() throws IOException {
483483 "pt.append!(t)\n " +
484484 "flushTSDBCache()\n " ;
485485 conn .run (script );
486- BasicTable entity1 = (BasicTable )conn .run ("select * from loadTable( \" dfs://testIOT3 \" , `pt) order by deviceId;" );
486+ BasicTable entity1 = (BasicTable )conn .run ("select * from loadTable( \" dfs://testIOT333 \" , `pt) order by deviceId;" );
487487 Assert .assertEquals ("['Q',233,-233,233121,true,233.33999634,233.34,loc1,AAA,bbb,xxx]" , entity1 .getColumn ("value" ).getString ());
488488 BasicIotAnyVector BIV = (BasicIotAnyVector )entity1 .getColumn ("value" );
489489 System .out .println (BIV .getString ());
@@ -497,9 +497,9 @@ public void test_iotAnyVector_allDateType_upload() throws IOException {
497497
498498 @ Test
499499 public void test_iotAnyVector_allDateType_upload_null () throws IOException {
500- String script = "if(existsDatabase(\" dfs://testIOT3 \" )) dropDatabase(\" dfs://testIOT3 \" )\n " +
501- " create database \" dfs://testIOT3 \" partitioned by VALUE(1..20),RANGE(2020.01.01 2022.01.01 2025.01.01), engine='TSDB'\n " +
502- " create table \" dfs://testIOT3 \" .\" pt\" (\n " +
500+ String script = "if(existsDatabase(\" dfs://testIOT333 \" )) dropDatabase(\" dfs://testIOT333 \" )\n " +
501+ " create database \" dfs://testIOT333 \" partitioned by VALUE(1..20),RANGE(2020.01.01 2022.01.01 2025.01.01), engine='TSDB'\n " +
502+ " create table \" dfs://testIOT333 \" .\" pt\" (\n " +
503503 " deviceId INT,\n " +
504504 " timestamp TIMESTAMP,\n " +
505505 " location SYMBOL,\n " +
@@ -508,7 +508,7 @@ public void test_iotAnyVector_allDateType_upload_null() throws IOException {
508508 "partitioned by deviceId, timestamp,\n " +
509509 "sortColumns=[`deviceId, `location, `timestamp],\n " +
510510 "latestKeyCache=true;\n " +
511- "pt = loadTable(\" dfs://testIOT3 \" ,\" pt\" );\n " +
511+ "pt = loadTable(\" dfs://testIOT333 \" ,\" pt\" );\n " +
512512 "t=table([1] as deviceId, [now()] as timestamp, [`loc1] as location, [char(NULL)] as value)\n " +
513513 "pt.append!(t)\n " +
514514 "flushTSDBCache()\n " +
@@ -537,7 +537,7 @@ public void test_iotAnyVector_allDateType_upload_null() throws IOException {
537537 "pt.append!(t)\n " +
538538 "flushTSDBCache()\n " ;
539539 conn .run (script );
540- BasicTable entity1 = (BasicTable )conn .run ("select * from loadTable( \" dfs://testIOT3 \" , `pt) order by deviceId;" );
540+ BasicTable entity1 = (BasicTable )conn .run ("select * from loadTable( \" dfs://testIOT333 \" , `pt) order by deviceId;" );
541541 Assert .assertEquals ("[,,,,,,,,,AAA,AAA]" , entity1 .getColumn ("value" ).getString ());
542542 BasicIotAnyVector BIV = (BasicIotAnyVector )entity1 .getColumn ("value" );
543543 System .out .println (BIV .getString ());
@@ -563,10 +563,11 @@ public void test_iotAnyVector_allDateType_upload_null() throws IOException {
563563 System .out .println (entity33 .getString ());
564564 Assert .assertEquals ("IOTANY" , entity33 .getColumn (0 ).getString (0 ));
565565
566- BasicIotAnyVector entity4 = (BasicIotAnyVector )conn .run ("exec value from loadTable( \" dfs://testIOT3\" , `pt) order by deviceId limit 9 ;" );
567- System .out .println (entity4 .getString ());
566+ BasicTable entity4 = (BasicTable )conn .run ("select * from loadTable( \" dfs://testIOT333\" , `pt) order by deviceId limit 9 ;" );
567+ System .out .println (entity4 .getColumn ("value" ));
568+ BasicIotAnyVector entity44 = (BasicIotAnyVector )entity4 .getColumn ("value" );
568569 Map <String , Entity > map2 = new HashMap <>();
569- map2 .put ("iotAny3" , entity4 );
570+ map2 .put ("iotAny3" , entity44 );
570571 conn .upload (map2 );
571572 BasicIotAnyVector entity5 = (BasicIotAnyVector )conn .run ("iotAny3" );
572573 System .out .println (entity5 .getString ());
0 commit comments