Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.UnsupportedOperationException: com.facebook.presto.spi.type.LongDecimalType #8484

Closed
dterror-zz opened this issue Jul 12, 2017 · 4 comments

Comments

@dterror-zz
Copy link

I have a Parquet table defined as:

CREATE TABLE table_name (
   latitude decimal(18,14),
   longitude decimal(18,14),
)
WITH (
   external_location = 'hdfs://somewhere',
   format = 'PARQUET'
)

The parquet file's schema is:

message parquet_schema {
  optional int64 latitude (DECIMAL(18,14));
  optional int64 longitude (DECIMAL(18,14));
}

and when I try to query it, I get:

Query failed (#query_id): com.facebook.presto.spi.type.LongDecimalType
java.lang.RuntimeException: java.lang.UnsupportedOperationException: com.facebook.presto.spi.type.LongDecimalType
	at com.facebook.presto.spi.type.AbstractType.writeLong(AbstractType.java:111)
	at com.facebook.presto.hive.parquet.reader.ParquetLongColumnReader.readValues(ParquetLongColumnReader.java:39)
	at com.facebook.presto.hive.parquet.reader.ParquetColumnReader.readPrimitive(ParquetColumnReader.java:186)
	at com.facebook.presto.hive.parquet.reader.ParquetReader.readPrimitive(ParquetReader.java:176)
	at com.facebook.presto.hive.parquet.ParquetPageSource$ParquetBlockLoader.load(ParquetPageSource.java:271)
	at com.facebook.presto.hive.parquet.ParquetPageSource$ParquetBlockLoader.load(ParquetPageSource.java:247)
	at com.facebook.presto.spi.block.LazyBlock.assureLoaded(LazyBlock.java:235)

Indeed it doesn't seem like LongDecimalType implements writeLong, so I'm not certain why it's even getting into that codepath.

We're on version 0.164, but Decimals (with precision of 18) should be supported in 0.164, right?

Any clarification is appreciated,
thanks!

@nezihyigitbasi
Copy link
Contributor

nezihyigitbasi commented Jul 12, 2017

It should be supported now, can you please try the latest Presto version (0.180)?

@dterror-zz
Copy link
Author

👍 thanks @nezihyigitbasi - so Decimals(>17,x) weren't supported in 0.164

@nezihyigitbasi
Copy link
Contributor

Please reopen if the latest version doesn't work for you.

@ghost
Copy link

ghost commented Dec 20, 2017

Hi I m using presto 0.180 . I m trying query table in hive it gives following exception.
java.lang.UnsupportedOperationException: com.facebook.presto.spi.type.VarcharType
at com.facebook.presto.spi.type.AbstractType.writeLong(AbstractType.java:111)
at com.facebook.presto.hive.parquet.reader.ParquetLongColumnReader.readValue(ParquetLongColumnReader.java:32)
at com.facebook.presto.hive.parquet.reader.ParquetColumnReader.readValues(ParquetColumnReader.java:179)
at com.facebook.presto.hive.parquet.reader.ParquetColumnReader.readPrimitive(ParquetColumnReader.java:161)
at com.facebook.presto.hive.parquet.reader.ParquetReader.readPrimitive(ParquetReader.java:265)
at com.facebook.presto.hive.parquet.reader.ParquetReader.readPrimitive(ParquetReader.java:247)
at com.facebook.presto.hive.parquet.ParquetPageSource$ParquetBlockLoader.load(ParquetPageSource.java:283)
at com.facebook.presto.hive.parquet.ParquetPageSource$ParquetBlockLoader.load(ParquetPageSource.java:259)
at com.facebook.presto.spi.block.LazyBlock.assureLoaded(LazyBlock.java:253)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants