@@ -49,6 +49,7 @@ func TestQuery(t *testing.T) {
4949 StringType : "some string" ,
5050 TimestampType : athenaTimestamp (time .Date (2006 , 1 , 2 , 3 , 4 , 11 , 0 , time .UTC )),
5151 DateType : athenaDate (time .Date (2006 , 1 , 2 , 0 , 0 , 0 , 0 , time .UTC )),
52+ DecimalType : 1001 ,
5253 },
5354 {
5455 SmallintType : 9 ,
@@ -60,6 +61,7 @@ func TestQuery(t *testing.T) {
6061 StringType : "another string" ,
6162 TimestampType : athenaTimestamp (time .Date (2017 , 12 , 3 , 1 , 11 , 12 , 0 , time .UTC )),
6263 DateType : athenaDate (time .Date (2017 , 12 , 3 , 0 , 0 , 0 , 0 , time .UTC )),
64+ DecimalType : 0 ,
6365 },
6466 {
6567 SmallintType : 9 ,
@@ -71,9 +73,10 @@ func TestQuery(t *testing.T) {
7173 StringType : "another string" ,
7274 TimestampType : athenaTimestamp (time .Date (2017 , 12 , 3 , 20 , 11 , 12 , 0 , time .UTC )),
7375 DateType : athenaDate (time .Date (2017 , 12 , 3 , 0 , 0 , 0 , 0 , time .UTC )),
76+ DecimalType : 0.48 ,
7477 },
7578 }
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" }
7780 harness .uploadData (expected )
7881
7982 rows := harness .mustQuery ("select * from %s" , harness .table )
@@ -94,6 +97,7 @@ func TestQuery(t *testing.T) {
9497 & row .StringType ,
9598 & row .TimestampType ,
9699 & row .DateType ,
100+ & row .DecimalType ,
97101 ))
98102
99103 assert .Equal (t , expected [index ], row , fmt .Sprintf ("index: %d" , index ))
@@ -133,6 +137,7 @@ type dummyRow struct {
133137 StringType string `json:"stringType"`
134138 TimestampType athenaTimestamp `json:"timestampType"`
135139 DateType athenaDate `json:"dateType"`
140+ DecimalType float64 `json:"decimalType"`
136141}
137142
138143type athenaHarness struct {
@@ -169,7 +174,8 @@ func (a *athenaHarness) setupTable() {
169174 doubleType double,
170175 stringType string,
171176 timestampType timestamp,
172- dateType date
177+ dateType date,
178+ decimalType decimal(11, 5)
173179)
174180ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
175181WITH SERDEPROPERTIES (
0 commit comments