6
6
import java .util .ArrayList ;
7
7
import java .util .Properties ;
8
8
import org .apache .hadoop .conf .Configuration ;
9
- import org .apache .hadoop .hive .serde2 .SerDe ;
9
+ import org .apache .hadoop .hive .serde2 .AbstractSerDe ;
10
10
import org .apache .hadoop .hive .serde2 .io .ByteWritable ;
11
11
import org .apache .hadoop .hive .serde2 .io .DateWritable ;
12
12
import org .apache .hadoop .hive .serde2 .io .ShortWritable ;
@@ -47,7 +47,7 @@ public void TestIntWrite() throws Exception {
47
47
Properties proptab = new Properties ();
48
48
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMNS , "num" );
49
49
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMN_TYPES , "int" );
50
- SerDe jserde = mkSerDe (proptab );
50
+ AbstractSerDe jserde = mkSerDe (proptab );
51
51
StructObjectInspector rowOI = (StructObjectInspector )jserde .getObjectInspector ();
52
52
53
53
// {"attributes":{"num":7}}
@@ -65,7 +65,7 @@ public void TestEpochWrite() throws Exception {
65
65
Properties proptab = new Properties ();
66
66
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMNS , "when" );
67
67
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMN_TYPES , "date" );
68
- SerDe jserde = mkSerDe (proptab );
68
+ AbstractSerDe jserde = mkSerDe (proptab );
69
69
StructObjectInspector rowOI = (StructObjectInspector )jserde .getObjectInspector ();
70
70
71
71
// {"attributes":{"when":147147147147}}
@@ -87,7 +87,7 @@ public void TestTimeWrite() throws Exception {
87
87
Properties proptab = new Properties ();
88
88
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMNS , "when" );
89
89
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMN_TYPES , "timestamp" );
90
- SerDe jserde = mkSerDe (proptab );
90
+ AbstractSerDe jserde = mkSerDe (proptab );
91
91
StructObjectInspector rowOI = (StructObjectInspector )jserde .getObjectInspector ();
92
92
93
93
// {"attributes":{"when":147147147147}}
@@ -108,7 +108,7 @@ public void TestPointWrite() throws Exception {
108
108
Properties proptab = new Properties ();
109
109
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMNS , "shape" );
110
110
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMN_TYPES , "binary" );
111
- SerDe jserde = mkSerDe (proptab );
111
+ AbstractSerDe jserde = mkSerDe (proptab );
112
112
StructObjectInspector rowOI = (StructObjectInspector )jserde .getObjectInspector ();
113
113
114
114
// {"attributes":{},"geometry":{"x":15.0,"y":5.0}}
@@ -126,7 +126,7 @@ public void TestIntParse() throws Exception {
126
126
Configuration config = new Configuration ();
127
127
Text value = new Text ();
128
128
129
- SerDe jserde = new EsriJsonSerDe ();
129
+ AbstractSerDe jserde = new EsriJsonSerDe ();
130
130
Properties proptab = new Properties ();
131
131
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMNS , "num" );
132
132
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMN_TYPES , "int" );
@@ -151,7 +151,7 @@ public void TestDateParse() throws Exception {
151
151
Configuration config = new Configuration ();
152
152
Text value = new Text ();
153
153
154
- SerDe jserde = new EsriJsonSerDe ();
154
+ AbstractSerDe jserde = new EsriJsonSerDe ();
155
155
Properties proptab = new Properties ();
156
156
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMNS , "when" );
157
157
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMN_TYPES , "date" );
@@ -176,7 +176,7 @@ public void TestEpochParse() throws Exception {
176
176
Configuration config = new Configuration ();
177
177
Text value = new Text ();
178
178
179
- SerDe jserde = new EsriJsonSerDe ();
179
+ AbstractSerDe jserde = new EsriJsonSerDe ();
180
180
Properties proptab = new Properties ();
181
181
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMNS , "when" );
182
182
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMN_TYPES , "date" );
@@ -203,7 +203,7 @@ public void TestTimeParse() throws Exception {
203
203
Configuration config = new Configuration ();
204
204
Text value = new Text ();
205
205
206
- SerDe jserde = new EsriJsonSerDe ();
206
+ AbstractSerDe jserde = new EsriJsonSerDe ();
207
207
Properties proptab = new Properties ();
208
208
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMNS , "when" );
209
209
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMN_TYPES , "timestamp" );
@@ -242,7 +242,7 @@ public void TestPointParse() throws Exception {
242
242
Configuration config = new Configuration ();
243
243
Text value = new Text ();
244
244
245
- SerDe jserde = new EsriJsonSerDe ();
245
+ AbstractSerDe jserde = new EsriJsonSerDe ();
246
246
Properties proptab = new Properties ();
247
247
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMNS , "shape" );
248
248
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMN_TYPES , "binary" );
@@ -268,7 +268,7 @@ public void TestIntOnly() throws Exception {
268
268
Properties proptab = new Properties ();
269
269
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMNS , "num" );
270
270
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMN_TYPES , "int" );
271
- SerDe jserde = mkSerDe (proptab );
271
+ AbstractSerDe jserde = mkSerDe (proptab );
272
272
StructObjectInspector rowOI = (StructObjectInspector )jserde .getObjectInspector ();
273
273
274
274
addWritable (stuff , 7 );
@@ -289,7 +289,7 @@ public void TestPointOnly() throws Exception {
289
289
Properties proptab = new Properties ();
290
290
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMNS , "shape" );
291
291
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMN_TYPES , "binary" );
292
- SerDe jserde = mkSerDe (proptab );
292
+ AbstractSerDe jserde = mkSerDe (proptab );
293
293
StructObjectInspector rowOI = (StructObjectInspector )jserde .getObjectInspector ();
294
294
295
295
//value.set("{\"attributes\":{},\"geometry\":{\"x\":15.0,\"y\":5.0}}");
@@ -312,7 +312,7 @@ public void TestIntPoint() throws Exception {
312
312
Properties proptab = new Properties ();
313
313
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMNS , "num,shape" );
314
314
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMN_TYPES , "bigint,binary" );
315
- SerDe jserde = mkSerDe (proptab );
315
+ AbstractSerDe jserde = mkSerDe (proptab );
316
316
StructObjectInspector rowOI = (StructObjectInspector )jserde .getObjectInspector ();
317
317
318
318
//value.set("{\"attributes\":{\"num\":7},\"geometry\":{\"x\":15.0,\"y\":5.0}}");
@@ -339,7 +339,7 @@ public void TestNullAttr() throws Exception {
339
339
Properties proptab = new Properties ();
340
340
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMNS , "num" );
341
341
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMN_TYPES , "int" );
342
- SerDe jserde = mkSerDe (proptab );
342
+ AbstractSerDe jserde = mkSerDe (proptab );
343
343
StructObjectInspector rowOI = (StructObjectInspector )jserde .getObjectInspector ();
344
344
345
345
//value.set("{\"attributes\":{\"num\":7}}");
@@ -360,7 +360,7 @@ public void TestNullGeom() throws Exception {
360
360
Properties proptab = new Properties ();
361
361
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMNS , "shape" );
362
362
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMN_TYPES , "binary" );
363
- SerDe jserde = mkSerDe (proptab );
363
+ AbstractSerDe jserde = mkSerDe (proptab );
364
364
StructObjectInspector rowOI = (StructObjectInspector )jserde .getObjectInspector ();
365
365
366
366
//value.set("{\"attributes\":{},\"geometry\":{\"x\":15.0,\"y\":5.0}}");
@@ -382,7 +382,7 @@ public void TestColumnTypes() throws Exception {
382
382
Properties proptab = new Properties ();
383
383
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMNS , "flag,num1,num2,text" );
384
384
proptab .setProperty (HiveShims .serdeConstants .LIST_COLUMN_TYPES , "boolean,tinyint,smallint,string" );
385
- SerDe jserde = mkSerDe (proptab );
385
+ AbstractSerDe jserde = mkSerDe (proptab );
386
386
StructObjectInspector rowOI = (StructObjectInspector )jserde .getObjectInspector ();
387
387
388
388
// {"attributes":{"flag":false,"num":"5","text":"Point(15.0 5.0)"}}
@@ -430,7 +430,7 @@ public void LegacyName() throws Exception {
430
430
proptab.setProperty(HiveShims.serdeConstants.LIST_COLUMNS, "num,shape");
431
431
proptab.setProperty(HiveShims.serdeConstants.LIST_COLUMN_TYPES, "bigint,binary");
432
432
Configuration config = new Configuration();
433
- SerDe jserde = new JsonSerde();
433
+ AbstractSerDe jserde = new JsonSerde();
434
434
jserde.initialize(config, proptab);
435
435
StructObjectInspector rowOI = (StructObjectInspector)jserde.getObjectInspector();
436
436
@@ -453,9 +453,9 @@ public void LegacyName() throws Exception {
453
453
}
454
454
* */
455
455
456
- private SerDe mkSerDe (Properties proptab ) throws Exception {
456
+ private AbstractSerDe mkSerDe (Properties proptab ) throws Exception {
457
457
Configuration config = new Configuration ();
458
- SerDe jserde = new EsriJsonSerDe ();
458
+ AbstractSerDe jserde = new EsriJsonSerDe ();
459
459
jserde .initialize (config , proptab );
460
460
return jserde ;
461
461
}
0 commit comments