@@ -49,6 +49,7 @@ func TestQuery(t *testing.T) {
49
49
StringType : "some string" ,
50
50
TimestampType : athenaTimestamp (time .Date (2006 , 1 , 2 , 3 , 4 , 11 , 0 , time .UTC )),
51
51
DateType : athenaDate (time .Date (2006 , 1 , 2 , 0 , 0 , 0 , 0 , time .UTC )),
52
+ DecimalType : 1001 ,
52
53
},
53
54
{
54
55
SmallintType : 9 ,
@@ -60,6 +61,7 @@ func TestQuery(t *testing.T) {
60
61
StringType : "another string" ,
61
62
TimestampType : athenaTimestamp (time .Date (2017 , 12 , 3 , 1 , 11 , 12 , 0 , time .UTC )),
62
63
DateType : athenaDate (time .Date (2017 , 12 , 3 , 0 , 0 , 0 , 0 , time .UTC )),
64
+ DecimalType : 0 ,
63
65
},
64
66
{
65
67
SmallintType : 9 ,
@@ -71,9 +73,10 @@ func TestQuery(t *testing.T) {
71
73
StringType : "another string" ,
72
74
TimestampType : athenaTimestamp (time .Date (2017 , 12 , 3 , 20 , 11 , 12 , 0 , time .UTC )),
73
75
DateType : athenaDate (time .Date (2017 , 12 , 3 , 0 , 0 , 0 , 0 , time .UTC )),
76
+ DecimalType : 0.48 ,
74
77
},
75
78
}
76
- expectedTypeNames := []string {"varchar" , "smallint" , "integer" , "bigint" , "boolean" , "float" , "double" , "varchar" , "timestamp" , "date" }
79
+ expectedTypeNames := []string {"varchar" , "smallint" , "integer" , "bigint" , "boolean" , "float" , "double" , "varchar" , "timestamp" , "date" , "decimal" }
77
80
harness .uploadData (expected )
78
81
79
82
rows := harness .mustQuery ("select * from %s" , harness .table )
@@ -94,6 +97,7 @@ func TestQuery(t *testing.T) {
94
97
& row .StringType ,
95
98
& row .TimestampType ,
96
99
& row .DateType ,
100
+ & row .DecimalType ,
97
101
))
98
102
99
103
assert .Equal (t , expected [index ], row , fmt .Sprintf ("index: %d" , index ))
@@ -133,6 +137,7 @@ type dummyRow struct {
133
137
StringType string `json:"stringType"`
134
138
TimestampType athenaTimestamp `json:"timestampType"`
135
139
DateType athenaDate `json:"dateType"`
140
+ DecimalType float64 `json:"decimalType"`
136
141
}
137
142
138
143
type athenaHarness struct {
@@ -169,7 +174,8 @@ func (a *athenaHarness) setupTable() {
169
174
doubleType double,
170
175
stringType string,
171
176
timestampType timestamp,
172
- dateType date
177
+ dateType date,
178
+ decimalType decimal(11, 5)
173
179
)
174
180
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
175
181
WITH SERDEPROPERTIES (
0 commit comments