7

I created a table with three columns - id, name, position, then I stored the data into s3 using orc format using spark.

When I query select * from person it returns everything.

But when I query from presto, I get this error:

Query 20180919_151814_00019_33f5d failed: com.facebook.presto.spi.type.VarcharType
kc2001
  • 5,008
  • 4
  • 51
  • 92
Abdulhafeth Sartawi
  • 1,086
  • 1
  • 11
  • 20

1 Answers1

6

I have found the answer for the problem, when I stored the data in s3, the data inside the file was with one more column that was not defined in the hive table metastore.

So when Presto tried to query the data, it found that there are varchar instead of integer.

This also might happen if one record has a a type different than what is defined in the metastore.

I had to delete my data and import it again without that extra unneeded column

Abdulhafeth Sartawi
  • 1,086
  • 1
  • 11
  • 20
  • 4
    I came across the same problem. I have the dat in s3 in parquet format. it has a lot of columns. but i created a tablewith only 4 columns, then when i am trying to query it given the same error. can you please advice ? – John Deep May 23 '20 at 22:33