1818import java .util .Random ;
1919import java .util .UUID ;
2020
21- public class SamplePOJO {
21+ public class QuerySamplePOJO {
2222 private int int8 ;
2323 private int int8_default ;
2424 private int int16 ;
@@ -35,7 +35,7 @@ public class SamplePOJO {
3535 private int uint8 ;
3636 private int uint16 ;
3737 private long uint32 ;
38- private long uint64 ;
38+ private BigInteger uint64 ;
3939 private BigInteger uint128 ;
4040 private BigInteger uint256 ;
4141
@@ -67,12 +67,12 @@ public class SamplePOJO {
6767 private Inet6Address ipv6 ;
6868
6969 private List <String > array ;
70- private List <Integer > tuple ;
70+ // private List<? > tuple;
7171 private Map <String , Integer > map ;
7272 private List <Integer > nestedInnerInt ;
7373 private List <String > nestedInnerString ;
7474
75- public SamplePOJO () {
75+ public QuerySamplePOJO () {
7676 final Random random = new Random ();
7777 int8 = random .nextInt (128 );
7878 int16 = random .nextInt (32768 );
@@ -90,11 +90,16 @@ public SamplePOJO() {
9090
9191 int256 = upper1 .or (upper2 ).or (lower1 ).or (lower2 );
9292
93+
9394 uint8 = random .nextInt (255 );
9495 uint16 = random .nextInt (32768 );
9596 uint32 = (long ) (random .nextDouble () * 4294967295L );
96- uint64 = (long ) (random .nextDouble () * 18446744073709615L );
9797
98+ long rndUInt64 = random .nextLong ();
99+ uint64 = BigInteger .valueOf (rndUInt64 );
100+ if (rndUInt64 < 0 ) {
101+ uint64 = uint64 .add (BigInteger .ONE .shiftLeft (64 ));
102+ }
98103
99104 uint128 = upper .or (lower ).abs ();
100105 uint256 = upper1 .or (upper2 ).or (lower1 ).or (lower2 ).abs ();
@@ -137,7 +142,7 @@ public SamplePOJO() {
137142 }
138143
139144 array = Arrays .asList ("a" , "b" , "c" , "d" , "e" , "f" , "g" , "h" , "i" , "j" , "k" , "l" , "m" , "n" , "o" , "p" , "q" , "r" , "s" , "t" , "u" , "v" , "w" , "x" , "y" , "z" );
140- tuple = Arrays .asList (1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 );
145+ // tuple = Arrays.asList(new Object[]{random.nextInt(), random.nextDouble(), "a", "b" } );
141146 map = new HashMap <>();
142147 for (int i = 0 ; i < 10 ; i ++) {
143148 map .put (String .valueOf ((char ) ('a' + i )), i + 1 );
@@ -248,11 +253,11 @@ public void setUint32(long uint32) {
248253 this .uint32 = uint32 ;
249254 }
250255
251- public long getUint64 () {
256+ public BigInteger getUint64 () {
252257 return uint64 ;
253258 }
254259
255- public void setUint64 (long uint64 ) {
260+ public void setUint64 (BigInteger uint64 ) {
256261 this .uint64 = uint64 ;
257262 }
258263
@@ -424,13 +429,13 @@ public void setArray(List<String> array) {
424429 this .array = array ;
425430 }
426431
427- public List <Integer > getTuple () {
428- return tuple ;
429- }
432+ // public List<? > getTuple() {
433+ // return tuple;
434+ // }
430435
431- public void setTuple (List <Integer > tuple ) {
432- this .tuple = tuple ;
433- }
436+ // public void setTuple(List<? > tuple) {
437+ // this.tuple = tuple;
438+ // }
434439
435440 public Map <String , Integer > getMap () {
436441 return map ;
@@ -460,18 +465,18 @@ public void setNestedInnerString(List<String> nestedInnerString) {
460465 public boolean equals (Object o ) {
461466 if (this == o ) return true ;
462467 if (o == null || getClass () != o .getClass ()) return false ;
463- SamplePOJO that = (SamplePOJO ) o ;
464- return int8 == that .int8 && int16 == that .int16 && int32 == that .int32 && int64 == that .int64 && uint8 == that .uint8 && uint16 == that .uint16 && uint32 == that .uint32 && uint64 == that .uint64 && Float .compare (float32 , that .float32 ) == 0 && Double .compare (float64 , that .float64 ) == 0 && bool == that .bool && enum8 == that .enum8 && enum16 == that .enum16 && Objects .equals (int128 , that .int128 ) && Objects .equals (int256 , that .int256 ) && Objects .equals (uint128 , that .uint128 ) && Objects .equals (uint256 , that .uint256 ) && Objects .equals (decimal32 , that .decimal32 ) && Objects .equals (decimal64 , that .decimal64 ) && Objects .equals (decimal128 , that .decimal128 ) && Objects .equals (decimal256 , that .decimal256 ) && Objects .equals (string , that .string ) && Objects .equals (fixedString , that .fixedString ) && Objects .equals (date , that .date ) && Objects .equals (date32 , that .date32 ) && Objects .equals (dateTime , that .dateTime ) && Objects .equals (dateTime64 , that .dateTime64 ) && Objects .equals (uuid , that .uuid ) && Objects .equals (ipv4 , that .ipv4 ) && Objects .equals (ipv6 , that .ipv6 ) && Objects .equals (array , that .array ) && Objects .equals (tuple , that .tuple ) && Objects .equals (map , that .map ) && Objects .equals (nestedInnerInt , that .nestedInnerInt ) && Objects .equals (nestedInnerString , that .nestedInnerString );
468+ QuerySamplePOJO that = (QuerySamplePOJO ) o ;
469+ return int8 == that .int8 && int8_default == that .int8_default && int16 == that .int16 && int16_default == that .int16_default && int32 == that .int32 && int32_default == that .int32_default && int64 == that .int64 && int64_default == that .int64_default && uint8 == that .uint8 && uint16 == that .uint16 && uint32 == that .uint32 && Float .compare (float32 , that .float32 ) == 0 && Double .compare (float64 , that .float64 ) == 0 && bool == that .bool && enum8 == that .enum8 && enum16 == that .enum16 && Objects .equals (int128 , that .int128 ) && Objects .equals (int128_default , that .int128_default ) && Objects .equals (int256 , that .int256 ) && Objects .equals (int256_default , that .int256_default ) && Objects .equals (uint64 , that .uint64 ) && Objects .equals (uint128 , that .uint128 ) && Objects .equals (uint256 , that .uint256 ) && Objects .equals (decimal32 , that .decimal32 ) && Objects .equals (decimal64 , that .decimal64 ) && Objects .equals (decimal128 , that .decimal128 ) && Objects .equals (decimal256 , that .decimal256 ) && Objects .equals (string , that .string ) && Objects .equals (fixedString , that .fixedString ) && Objects .equals (date , that .date ) && Objects .equals (date32 , that .date32 ) && Objects .equals (dateTime , that .dateTime ) && Objects .equals (dateTime64 , that .dateTime64 ) && Objects .equals (uuid , that .uuid ) && Objects .equals (ipv4 , that .ipv4 ) && Objects .equals (ipv6 , that .ipv6 ) && Objects .equals (array , that .array ) && Objects .equals (map , that .map ) && Objects .equals (nestedInnerInt , that .nestedInnerInt ) && Objects .equals (nestedInnerString , that .nestedInnerString );
465470 }
466471
467472 @ Override
468473 public int hashCode () {
469- return Objects .hash (int8 , int16 , int32 , int64 , int128 , int256 , uint8 , uint16 , uint32 , uint64 , uint128 , uint256 , float32 , float64 , decimal32 , decimal64 , decimal128 , decimal256 , bool , string , fixedString , date , date32 , dateTime , dateTime64 , uuid , enum8 , enum16 , ipv4 , ipv6 , array , tuple , map , nestedInnerInt , nestedInnerString );
474+ return Objects .hash (int8 , int8_default , int16 , int16_default , int32 , int32_default , int64 , int64_default , int128 , int128_default , int256 , int256_default , uint8 , uint16 , uint32 , uint64 , uint128 , uint256 , float32 , float64 , decimal32 , decimal64 , decimal128 , decimal256 , bool , string , fixedString , date , date32 , dateTime , dateTime64 , uuid , enum8 , enum16 , ipv4 , ipv6 , array , map , nestedInnerInt , nestedInnerString );
470475 }
471476
472477 @ Override
473478 public String toString () {
474- return "SamplePOJO {" +
479+ return "QuerySamplePOJO {" +
475480 "int8=" + int8 +
476481 ", int8_default=" + int8_default +
477482 ", int16=" + int16 +
@@ -509,7 +514,6 @@ public String toString() {
509514 ", ipv4=" + ipv4 +
510515 ", ipv6=" + ipv6 +
511516 ", array=" + array +
512- ", tuple=" + tuple +
513517 ", map=" + map +
514518 ", nestedInnerInt=" + nestedInnerInt +
515519 ", nestedInnerString=" + nestedInnerString +
@@ -555,7 +559,7 @@ public static String generateTableCreateSQL(String tableName) {
555559 "ipv4 IPv4, " +
556560 "ipv6 IPv6, " +
557561 "array Array(String), " +
558- "tuple Tuple(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32), " +
562+ // "tuple Tuple(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32), " +
559563 "map Map(String, Int32), " +
560564 "nested Nested (innerInt Int32, innerString String)" +
561565 ") ENGINE = Memory" ;
0 commit comments