@@ -1910,13 +1910,11 @@ public void test_insert_arrayVector_different_length()throws Exception {
19101910 }
19111911
19121912 @ Test (timeout = 120000 )
1913- public void test_insert_arrayVector_int ()throws Exception {
1914-
1913+ public void test_insert_arrayVector_int_Integer ()throws Exception {
19151914 StringBuilder sb = new StringBuilder ();
19161915 sb .append ("t = table(1000:0, `int`arrayv," +
19171916 "[INT,INT[]]);" +
19181917 "share t as t1;" );
1919-
19201918 conn .run (sb .toString ());
19211919 mutithreadTableWriter_ = new MultithreadedTableWriter (HOST , PORT , "admin" , "123456" ,
19221920 "" , "t1" , false , false ,null ,1 , 1 ,
@@ -1935,9 +1933,33 @@ public void test_insert_arrayVector_int()throws Exception {
19351933 }
19361934 conn .run ("undef(`t1,SHARED)" );
19371935 }
1936+ @ Test (timeout = 120000 )
1937+ public void test_insert_arrayVector_int_int ()throws Exception {
1938+ StringBuilder sb = new StringBuilder ();
1939+ sb .append ("t = table(1000:0, `int`arrayv," +
1940+ "[INT,INT[]]);" +
1941+ "share t as t1;" );
1942+ conn .run (sb .toString ());
1943+ mutithreadTableWriter_ = new MultithreadedTableWriter (HOST , PORT , "admin" , "123456" ,
1944+ "" , "t1" , false , false ,null ,1 , 1 ,
1945+ 1 , "int" );
1946+ for (int i =0 ;i <10 ;i ++) {
1947+ ErrorCodeInfo pErrorInfo = mutithreadTableWriter_ .insert ( 1 ,new int []{1 , i });
1948+ assertEquals ("code= info=" ,pErrorInfo .toString ());
1949+ }
1950+ mutithreadTableWriter_ .waitForThreadCompletion ();
1951+ // conn.run(String.format("insert into t1 values('%s',%s)",1,"1232"));
1952+ BasicTable bt = (BasicTable ) conn .run ("select * from t1;" );
1953+ assertEquals (10 ,bt .rows ());
1954+ for (int i =0 ;i <10 ;i ++) {
1955+ assertEquals (1 , ((Scalar )((BasicArrayVector )bt .getColumn ("arrayv" )).getVectorValue (i ).get (0 )).getNumber ());
1956+ assertEquals (i , ((Scalar )((BasicArrayVector )bt .getColumn ("arrayv" )).getVectorValue (i ).get (1 )).getNumber ());
1957+ }
1958+ conn .run ("undef(`t1,SHARED)" );
1959+ }
19381960
19391961 @ Test (timeout = 60000 )
1940- public void test_insert_arrayVector_char ()throws Exception {
1962+ public void test_insert_arrayVector_char_Byte ()throws Exception {
19411963
19421964 StringBuilder sb = new StringBuilder ();
19431965 sb .append ("t = table(1000:0, `int`arrayv," +
@@ -1961,9 +1983,33 @@ public void test_insert_arrayVector_char()throws Exception {
19611983 }
19621984 conn .run ("undef(`t1,SHARED)" );
19631985 }
1986+ @ Test (timeout = 60000 )
1987+ public void test_insert_arrayVector_char_byte ()throws Exception {
1988+
1989+ StringBuilder sb = new StringBuilder ();
1990+ sb .append ("t = table(1000:0, `int`arrayv," +
1991+ "[INT,CHAR[]]);" +
1992+ "share t as t1;" );
19641993
1994+ conn .run (sb .toString ());
1995+ mutithreadTableWriter_ = new MultithreadedTableWriter (HOST , PORT , "admin" , "123456" ,
1996+ "" , "t1" , false , false ,null ,1 , 1 ,
1997+ 1 , "int" );
1998+ for (int i =0 ;i <10 ;i ++) {
1999+ ErrorCodeInfo pErrorInfo = mutithreadTableWriter_ .insert ( 1 ,new byte []{'a' ,'3' });
2000+ assertEquals ("code= info=" ,pErrorInfo .toString ());
2001+ }
2002+ mutithreadTableWriter_ .waitForThreadCompletion ();
2003+ // conn.run(String.format("insert into t1 values('%s',%s)",1,"1232"));
2004+ BasicTable bt = (BasicTable ) conn .run ("select * from t1;" );
2005+ assertEquals (10 ,bt .rows ());
2006+ for (int i =0 ;i <10 ;i ++) {
2007+ assertEquals ("['a','3']" , ((BasicArrayVector )bt .getColumn ("arrayv" )).getVectorValue (i ).getString ());
2008+ }
2009+ conn .run ("undef(`t1,SHARED)" );
2010+ }
19652011 @ Test (timeout = 120000 )
1966- public void test_insert_arrayVector_bool ()throws Exception {
2012+ public void test_insert_arrayVector_bool_Boolean ()throws Exception {
19672013
19682014 StringBuilder sb = new StringBuilder ();
19692015 sb .append ("t = table(1000:0, `int`arrayv," +
@@ -1987,9 +2033,34 @@ public void test_insert_arrayVector_bool()throws Exception {
19872033 assertEquals ("false" , ((BasicArrayVector )bt .getColumn ("arrayv" )).getVectorValue (i ).get (1 ).getString ());
19882034 }
19892035 }
2036+ @ Test (timeout = 120000 )
2037+ public void test_insert_arrayVector_bool_bool ()throws Exception {
2038+
2039+ StringBuilder sb = new StringBuilder ();
2040+ sb .append ("t = table(1000:0, `int`arrayv," +
2041+ "[INT,BOOL[]]);" +
2042+ "share t as t1;" );
2043+
2044+ conn .run (sb .toString ());
2045+ mutithreadTableWriter_ = new MultithreadedTableWriter (HOST , PORT , "admin" , "123456" ,
2046+ "" , "t1" , false , false ,null ,1 , 1 ,
2047+ 1 , "int" );
2048+ for (int i =0 ;i <10 ;i ++) {
2049+ ErrorCodeInfo pErrorInfo = mutithreadTableWriter_ .insert ( 1 ,new boolean []{true ,false });
2050+ assertEquals ("code= info=" ,pErrorInfo .toString ());
2051+ }
2052+ mutithreadTableWriter_ .waitForThreadCompletion ();
2053+ // conn.run(String.format("insert into t1 values('%s',%s)",1,"1232"));
2054+ BasicTable bt = (BasicTable ) conn .run ("select * from t1;" );
2055+ assertEquals (10 ,bt .rows ());
2056+ for (int i =0 ;i <10 ;i ++) {
2057+ assertEquals ("true" ,((BasicArrayVector )bt .getColumn ("arrayv" )).getVectorValue (i ).get (0 ).getString ());
2058+ assertEquals ("false" , ((BasicArrayVector )bt .getColumn ("arrayv" )).getVectorValue (i ).get (1 ).getString ());
2059+ }
2060+ }
19902061
19912062 @ Test (timeout = 120000 )
1992- public void test_insert_arrayVector_long ()throws Exception {
2063+ public void test_insert_arrayVector_long_Long ()throws Exception {
19932064
19942065 StringBuilder sb = new StringBuilder ();
19952066 sb .append ("t = table(1000:0, `int`arrayv," +
@@ -2013,9 +2084,34 @@ public void test_insert_arrayVector_long()throws Exception {
20132084 assertEquals (Long .valueOf (i ), ((Scalar )((BasicArrayVector )bt .getColumn ("arrayv" )).getVectorValue (i ).get (1 )).getNumber ());
20142085 }
20152086 }
2087+ @ Test (timeout = 120000 )
2088+ public void test_insert_arrayVector_long_long ()throws Exception {
2089+
2090+ StringBuilder sb = new StringBuilder ();
2091+ sb .append ("t = table(1000:0, `int`arrayv," +
2092+ "[INT,LONG[]]);" +
2093+ "share t as t1;" );
2094+ int time =1024 ;
2095+ conn .run (sb .toString ());
2096+ mutithreadTableWriter_ = new MultithreadedTableWriter (HOST , PORT , "admin" , "123456" ,
2097+ "" , "t1" , false , false ,null ,1 , 1 ,
2098+ 1 , "arrayv" );
2099+ for (int i =0 ;i <time ;i ++) {
2100+ ErrorCodeInfo pErrorInfo = mutithreadTableWriter_ .insert ( 1 , new long []{1l , (long )i });
2101+ assertEquals ("code= info=" ,pErrorInfo .toString ());
2102+ }
2103+ mutithreadTableWriter_ .waitForThreadCompletion ();
2104+ // conn.run(String.format("insert into t1 values('%s',%s)",1,"1232"));
2105+ BasicTable bt = (BasicTable ) conn .run ("select * from t1;" );
2106+ assertEquals (time ,bt .rows ());
2107+ for (int i =0 ;i <time ;i ++) {
2108+ assertEquals (1l , ((Scalar )((BasicArrayVector )bt .getColumn ("arrayv" )).getVectorValue (i ).get (0 )).getNumber ());
2109+ assertEquals (Long .valueOf (i ), ((Scalar )((BasicArrayVector )bt .getColumn ("arrayv" )).getVectorValue (i ).get (1 )).getNumber ());
2110+ }
2111+ }
20162112
20172113 @ Test (timeout = 120000 )
2018- public void test_insert_arrayVector_short ()throws Exception {
2114+ public void test_insert_arrayVector_short_Short ()throws Exception {
20192115
20202116 StringBuilder sb = new StringBuilder ();
20212117 sb .append ("t = table(1000:0, `int`arrayv," +
@@ -2038,9 +2134,32 @@ public void test_insert_arrayVector_short()throws Exception {
20382134 assertEquals (Short .valueOf ("" +i +"" ), ((Scalar )((BasicArrayVector )bt .getColumn ("arrayv" )).getVectorValue (i ).get (1 )).getNumber ());
20392135 }
20402136 }
2137+ @ Test (timeout = 120000 )
2138+ public void test_insert_arrayVector_short_short ()throws Exception {
20412139
2140+ StringBuilder sb = new StringBuilder ();
2141+ sb .append ("t = table(1000:0, `int`arrayv," +
2142+ "[INT,SHORT[]]);" +
2143+ "share t as t1;" );
2144+ int time =10240 ;
2145+ conn .run (sb .toString ());
2146+ mutithreadTableWriter_ = new MultithreadedTableWriter (HOST , PORT , "admin" , "123456" ,
2147+ "" , "t1" , false , false ,null ,1 , 1 ,
2148+ 1 , "arrayv" );
2149+ for (short i =0 ;i <time ;i ++) {
2150+ ErrorCodeInfo pErrorInfo = mutithreadTableWriter_ .insert ( 1 , new short []{1 ,i });
2151+ assertEquals ("code= info=" ,pErrorInfo .toString ());
2152+ }
2153+ mutithreadTableWriter_ .waitForThreadCompletion ();
2154+ BasicTable bt = (BasicTable ) conn .run ("select * from t1;" );
2155+ assertEquals (time ,bt .rows ());
2156+ for (int i =0 ;i <time ;i ++) {
2157+ assertEquals (Short .valueOf ("1" ), ((Scalar )((BasicArrayVector )bt .getColumn ("arrayv" )).getVectorValue (i ).get (0 )).getNumber ());
2158+ assertEquals (Short .valueOf ("" +i +"" ), ((Scalar )((BasicArrayVector )bt .getColumn ("arrayv" )).getVectorValue (i ).get (1 )).getNumber ());
2159+ }
2160+ }
20422161 @ Test (timeout = 120000 )
2043- public void test_insert_arrayVector_float ()throws Exception {
2162+ public void test_insert_arrayVector_float_Float ()throws Exception {
20442163
20452164 StringBuilder sb = new StringBuilder ();
20462165 sb .append ("t = table(1000:0, `int`arrayv," +
@@ -2063,9 +2182,32 @@ public void test_insert_arrayVector_float()throws Exception {
20632182 assertEquals (Float .valueOf (i ), ((Scalar )((BasicArrayVector )bt .getColumn ("arrayv" )).getVectorValue (i ).get (1 )).getNumber ());
20642183 }
20652184 }
2185+ @ Test (timeout = 120000 )
2186+ public void test_insert_arrayVector_float_float ()throws Exception {
2187+ StringBuilder sb = new StringBuilder ();
2188+ sb .append ("t = table(1000:0, `int`arrayv," +
2189+ "[INT,FLOAT[]]);" +
2190+ "share t as t1;" );
2191+ int time =10240 ;
2192+ conn .run (sb .toString ());
2193+ mutithreadTableWriter_ = new MultithreadedTableWriter (HOST , PORT , "admin" , "123456" ,
2194+ "" , "t1" , false , false ,null ,1 , 1 ,
2195+ 1 , "arrayv" );
2196+ for (short i =0 ;i <time ;i ++) {
2197+ ErrorCodeInfo pErrorInfo = mutithreadTableWriter_ .insert ( 1 , new float []{0.0f ,(float )i });
2198+ assertEquals ("code= info=" ,pErrorInfo .toString ());
2199+ }
2200+ mutithreadTableWriter_ .waitForThreadCompletion ();
2201+ BasicTable bt = (BasicTable ) conn .run ("select * from t1;" );
2202+ assertEquals (time ,bt .rows ());
2203+ for (int i =0 ;i <time ;i ++) {
2204+ assertEquals (0.0f , ((Scalar )((BasicArrayVector )bt .getColumn ("arrayv" )).getVectorValue (i ).get (0 )).getNumber ());
2205+ assertEquals (Float .valueOf (i ), ((Scalar )((BasicArrayVector )bt .getColumn ("arrayv" )).getVectorValue (i ).get (1 )).getNumber ());
2206+ }
2207+ }
20662208
20672209 @ Test (timeout = 120000 )
2068- public void test_insert_arrayVector_double ()throws Exception {
2210+ public void test_insert_arrayVector_double_Double ()throws Exception {
20692211
20702212 StringBuilder sb = new StringBuilder ();
20712213 sb .append ("t = table(1000:0, `int`arrayv," +
@@ -2088,6 +2230,30 @@ public void test_insert_arrayVector_double()throws Exception {
20882230 assertEquals (Double .valueOf (i -10 ), ((Scalar )((BasicArrayVector )bt .getColumn ("arrayv" )).getVectorValue (i ).get (1 )).getNumber ());
20892231 }
20902232 }
2233+ @ Test (timeout = 120000 )
2234+ public void test_insert_arrayVector_double_double ()throws Exception {
2235+
2236+ StringBuilder sb = new StringBuilder ();
2237+ sb .append ("t = table(1000:0, `int`arrayv," +
2238+ "[INT,DOUBLE[]]);" +
2239+ "share t as t1;" );
2240+ int time =10240 ;
2241+ conn .run (sb .toString ());
2242+ mutithreadTableWriter_ = new MultithreadedTableWriter (HOST , PORT , "admin" , "123456" ,
2243+ "" , "t1" , false , false ,null ,1 , 1 ,
2244+ 1 , "arrayv" );
2245+ for (short i =0 ;i <time ;i ++) {
2246+ ErrorCodeInfo pErrorInfo = mutithreadTableWriter_ .insert ( 1 , new double []{(double )0 ,(double )(i -10 )});
2247+ assertEquals ("code= info=" ,pErrorInfo .toString ());
2248+ }
2249+ mutithreadTableWriter_ .waitForThreadCompletion ();
2250+ BasicTable bt = (BasicTable ) conn .run ("select * from t1;" );
2251+ assertEquals (time ,bt .rows ());
2252+ for (int i =0 ;i <time ;i ++) {
2253+ assertEquals (Double .valueOf (0 ), ((Scalar )((BasicArrayVector )bt .getColumn ("arrayv" )).getVectorValue (i ).get (0 )).getNumber ());
2254+ assertEquals (Double .valueOf (i -10 ), ((Scalar )((BasicArrayVector )bt .getColumn ("arrayv" )).getVectorValue (i ).get (1 )).getNumber ());
2255+ }
2256+ }
20912257
20922258 @ Test (timeout = 120000 )
20932259 public void test_insert_arrayVector_date_month ()throws Exception {
0 commit comments