@@ -26,6 +26,7 @@ import org.apache.spark.sql.catalyst.InternalRow
26
26
import org .apache .spark .sql .catalyst .expressions .{GenericInternalRow , GenericRow }
27
27
import org .apache .spark .sql .hbase .util .{BinaryBytesUtils , DataTypeUtils , HBaseKVHelper }
28
28
import org .apache .spark .sql .types ._
29
+ import org .apache .spark .unsafe .types .UTF8String
29
30
30
31
/**
31
32
* HBaseMainTest
@@ -73,13 +74,13 @@ class TestBaseWithSplitData extends TestBase {
73
74
74
75
val splitKeys : Array [Array [Byte ]] = if (useMultiplePartitions) {
75
76
Array (
76
- new GenericInternalRow (Array (256 , " p256 " , 128 : Short )),
77
- new GenericInternalRow (Array (32 , " p32 " , 256 : Short )),
78
- new GenericInternalRow (Array (- 32 , " n32 " , 128 : Short )),
79
- new GenericInternalRow (Array (- 256 , " n256 " , 256 : Short )),
80
- new GenericInternalRow (Array (- 128 , " n128 " , 128 : Short )),
81
- new GenericInternalRow (Array (0 , " zero " , 256 : Short )),
82
- new GenericInternalRow (Array (128 , " p128 " , 512 : Short ))
77
+ new GenericInternalRow (Array (256 , UTF8String .fromString( " p256 " ) , 128 : Short )),
78
+ new GenericInternalRow (Array (32 , UTF8String .fromString( " p32 " ) , 256 : Short )),
79
+ new GenericInternalRow (Array (- 32 , UTF8String .fromString( " n32 " ) , 128 : Short )),
80
+ new GenericInternalRow (Array (- 256 , UTF8String .fromString( " n256 " ) , 256 : Short )),
81
+ new GenericInternalRow (Array (- 128 , UTF8String .fromString( " n128 " ) , 128 : Short )),
82
+ new GenericInternalRow (Array (0 , UTF8String .fromString( " zero " ) , 256 : Short )),
83
+ new GenericInternalRow (Array (128 , UTF8String .fromString( " p128 " ) , 512 : Short ))
83
84
).map(HBaseKVHelper .makeRowKey(_, Seq (IntegerType , StringType , ShortType )))
84
85
} else {
85
86
null
@@ -125,72 +126,72 @@ class TestBaseWithSplitData extends TestBase {
125
126
htable.put(put)
126
127
}
127
128
128
- putNewTableIntoHBase(Seq (- 257 , " n257 " , 128 : Short ),
129
+ putNewTableIntoHBase(Seq (- 257 , UTF8String .fromString( " n257 " ) , 128 : Short ),
129
130
Seq (IntegerType , StringType , ShortType ),
130
131
Seq [Any ](1 .toByte, - 2048 , 12345678901234L , 1234.5678F ),
131
132
Seq (ByteType , IntegerType , LongType , FloatType ))
132
133
133
- putNewTableIntoHBase(Seq (- 255 , " n255 " , 128 : Short ),
134
+ putNewTableIntoHBase(Seq (- 255 , UTF8String .fromString( " n255 " ) , 128 : Short ),
134
135
Seq (IntegerType , StringType , ShortType ),
135
136
Seq [Any ](2 .toByte, - 1024 , 12345678901234L , 1234.5678F ),
136
137
Seq (ByteType , IntegerType , LongType , FloatType ))
137
138
138
- putNewTableIntoHBase(Seq (- 129 , " n129 " , 128 : Short ),
139
+ putNewTableIntoHBase(Seq (- 129 , UTF8String .fromString( " n129 " ) , 128 : Short ),
139
140
Seq (IntegerType , StringType , ShortType ),
140
141
Seq [Any ](3 .toByte, - 512 , 12345678901234L , 1234.5678F ),
141
142
Seq (ByteType , IntegerType , LongType , FloatType ))
142
143
143
- putNewTableIntoHBase(Seq (- 127 , " n127 " , 128 : Short ),
144
+ putNewTableIntoHBase(Seq (- 127 , UTF8String .fromString( " n127 " ) , 128 : Short ),
144
145
Seq (IntegerType , StringType , ShortType ),
145
146
Seq [Any ](4 .toByte, - 256 , 12345678901234L , 1234.5678F ),
146
147
Seq (ByteType , IntegerType , LongType , FloatType ))
147
148
148
- putNewTableIntoHBase(Seq (- 33 , " n33 " , 128 : Short ),
149
+ putNewTableIntoHBase(Seq (- 33 , UTF8String .fromString( " n33 " ) , 128 : Short ),
149
150
Seq (IntegerType , StringType , ShortType ),
150
151
Seq [Any ](5 .toByte, - 128 , 12345678901234L , 1234.5678F ),
151
152
Seq (ByteType , IntegerType , LongType , FloatType ))
152
153
153
- putNewTableIntoHBase(Seq (- 31 , " n31 " , 128 : Short ),
154
+ putNewTableIntoHBase(Seq (- 31 , UTF8String .fromString( " n31 " ) , 128 : Short ),
154
155
Seq (IntegerType , StringType , ShortType ),
155
156
Seq [Any ](6 .toByte, - 64 , 12345678901234L , 1234.5678F ),
156
157
Seq (ByteType , IntegerType , LongType , FloatType ))
157
158
158
- putNewTableIntoHBase(Seq (- 1 , " n1 " , 128 : Short ),
159
+ putNewTableIntoHBase(Seq (- 1 , UTF8String .fromString( " n1 " ) , 128 : Short ),
159
160
Seq (IntegerType , StringType , ShortType ),
160
161
Seq [Any ](7 .toByte, - 1 , 12345678901234L , 1234.5678F ),
161
162
Seq (ByteType , IntegerType , LongType , FloatType ))
162
163
163
- putNewTableIntoHBase(Seq (1 , " p1 " , 128 : Short ),
164
+ putNewTableIntoHBase(Seq (1 , UTF8String .fromString( " p1 " ) , 128 : Short ),
164
165
Seq (IntegerType , StringType , ShortType ),
165
166
Seq [Any ](8 .toByte, 1 , 12345678901234L , 1234.5678F ),
166
167
Seq (ByteType , IntegerType , LongType , FloatType ))
167
168
168
- putNewTableIntoHBase(Seq (31 , " p31 " , 128 : Short ),
169
+ putNewTableIntoHBase(Seq (31 , UTF8String .fromString( " p31 " ) , 128 : Short ),
169
170
Seq (IntegerType , StringType , ShortType ),
170
171
Seq [Any ](9 .toByte, 4 , 12345678901234L , 1234.5678F ),
171
172
Seq (ByteType , IntegerType , LongType , FloatType ))
172
173
173
- putNewTableIntoHBase(Seq (33 , " p33 " , 128 : Short ),
174
+ putNewTableIntoHBase(Seq (33 , UTF8String .fromString( " p33 " ) , 128 : Short ),
174
175
Seq (IntegerType , StringType , ShortType ),
175
176
Seq [Any ](10 .toByte, 64 , 12345678901234L , 1234.5678F ),
176
177
Seq (ByteType , IntegerType , LongType , FloatType ))
177
178
178
- putNewTableIntoHBase(Seq (127 , " p127 " , 128 : Short ),
179
+ putNewTableIntoHBase(Seq (127 , UTF8String .fromString( " p127 " ) , 128 : Short ),
179
180
Seq (IntegerType , StringType , ShortType ),
180
181
Seq [Any ](11 .toByte, 128 , 12345678901234L , 1234.5678F ),
181
182
Seq (ByteType , IntegerType , LongType , FloatType ))
182
183
183
- putNewTableIntoHBase(Seq (129 , " p129 " , 128 : Short ),
184
+ putNewTableIntoHBase(Seq (129 , UTF8String .fromString( " p129 " ) , 128 : Short ),
184
185
Seq (IntegerType , StringType , ShortType ),
185
186
Seq [Any ](12 .toByte, 256 , 12345678901234L , 1234.5678F ),
186
187
Seq (ByteType , IntegerType , LongType , FloatType ))
187
188
188
- putNewTableIntoHBase(Seq (255 , " p255 " , 128 : Short ),
189
+ putNewTableIntoHBase(Seq (255 , UTF8String .fromString( " p255 " ) , 128 : Short ),
189
190
Seq (IntegerType , StringType , ShortType ),
190
191
Seq [Any ](13 .toByte, 512 , 12345678901234L , 1234.5678F ),
191
192
Seq (ByteType , IntegerType , LongType , FloatType ))
192
193
193
- putNewTableIntoHBase(Seq (257 , " p257 " , 128 : Short ),
194
+ putNewTableIntoHBase(Seq (257 , UTF8String .fromString( " p257 " ) , 128 : Short ),
194
195
Seq (IntegerType , StringType , ShortType ),
195
196
Seq [Any ](14 .toByte, 1024 , 12345678901234L , 1234.5678F ),
196
197
Seq (ByteType , IntegerType , LongType , FloatType ))
0 commit comments