@@ -102,7 +102,7 @@ public void setUp() {
102102 .compressClientRequest (false )
103103 .compressServerResponse (useServerCompression )
104104 .useHttpCompression (useHttpCompression )
105- .useNewImplementation (System . getProperty ( "client.tests.useNewImplementation" , "false" ). equals ( " true" ) )
105+ .useNewImplementation (true )
106106 .build ();
107107
108108 delayForProfiler (0 );
@@ -159,6 +159,22 @@ public void testReadRecords() throws Exception {
159159 }
160160 }
161161
162+ @ Test (groups = {"integration" })
163+ public void testBigUnsignedInt () throws Exception {
164+ final BigInteger expected128 = BigInteger .valueOf (2 ).pow (128 ).subtract (BigInteger .ONE ).subtract (BigInteger .ONE );
165+ final BigInteger expected256 = BigInteger .valueOf (2 ).pow (256 ).subtract (BigInteger .ONE ).subtract (BigInteger .ONE );
166+
167+ String sqlQuery = "SELECT toUInt128('" + expected128 + "') as i128, toUInt256('" + expected256 + "') as i256" ;
168+ System .out .println (sqlQuery );
169+ Records records = client .queryRecords (sqlQuery ).get (3 , TimeUnit .SECONDS );
170+
171+ GenericRecord firstRecord = records .iterator ().next ();
172+
173+ System .out .println (firstRecord .getBigInteger ("i128" ));
174+ Assert .assertEquals (firstRecord .getBigInteger ("i128" ), expected128 );
175+ Assert .assertEquals (firstRecord .getBigInteger ("i256" ), expected256 );
176+ }
177+
162178 @ Test (groups = {"integration" })
163179 public void testReadRecordsGetFirstRecord () throws Exception {
164180 prepareDataSet (DATASET_TABLE , DATASET_COLUMNS , DATASET_VALUE_GENERATORS , 10 );
@@ -601,30 +617,31 @@ public void testIntegerDataTypes() {
601617 columns .add ("max_uint" + bits + " UInt" + bits );
602618
603619 final BigInteger minInt = BigInteger .valueOf (-1 ).multiply (BigInteger .valueOf (2 ).pow (bits - 1 ));
604- final BigInteger maxInt = BigInteger .valueOf (2 ).pow (bits - 1 ).subtract (BigInteger .ONE );
605- final BigInteger maxUInt = BigInteger .valueOf (2 ).pow (bits ).subtract (BigInteger .ONE );
620+ final BigInteger nearMaxInt = BigInteger .valueOf (2 ).pow (bits - 1 ).subtract (BigInteger .ONE ). subtract ( BigInteger . ONE ); //LE vs BigEndian test
621+ final BigInteger nearMaxUInt = BigInteger .valueOf (2 ).pow (bits ).subtract (BigInteger .ONE ). subtract ( BigInteger . ONE ); //LE vs BE
606622
607623 valueGenerators .add (() -> String .valueOf (minInt ));
608624 valueGenerators .add (() -> String .valueOf (0 ));
609- valueGenerators .add (() -> String .valueOf (maxInt ));
610- valueGenerators .add (() -> String .valueOf (maxUInt ));
625+ valueGenerators .add (() -> String .valueOf (nearMaxInt ));
626+ valueGenerators .add (() -> String .valueOf (nearMaxUInt ));
611627
612628 final int index = i - 3 ;
613629 verifiers .add (createNumberVerifier ("min_int" + bits , index * 4 + 1 , bits , true ,
614630 minInt ));
615631 verifiers .add (createNumberVerifier ("min_uint" + bits , index * 4 + 2 , bits , false ,
616632 BigInteger .ZERO ));
617633 verifiers .add (createNumberVerifier ("max_int" + bits , index * 4 + 3 , bits , true ,
618- maxInt ));
634+ nearMaxInt ));
619635 verifiers .add (createNumberVerifier ("max_uint" + bits , index * 4 + 4 , bits , false ,
620- maxUInt ));
636+ nearMaxUInt ));
621637 }
622638
623639// valueGenerators.forEach(r -> System.out.println(r.get()));
624640
625641 testDataTypes (columns , valueGenerators , verifiers );
626642 }
627643
644+
628645 @ Test (groups = {"integration" })
629646 public void testFloatDataTypes () {
630647 final List <String > columns = Arrays .asList (
0 commit comments