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

When set "es.mapping.date.rich" to false, DataFrame schema not change to String or Long #672

Closed
arman1371 opened this issue Jan 26, 2016 · 2 comments

Comments

@arman1371
Copy link

I set "es.mapping.date.rich" to false
My mapping in elasticsearch(version: 2.1.1) is:

"collectionTimestamp" : {
    "type" : "date",
    "format" : "strict_date_optional_time||epoch_millis"
}

when i want to read from elasticsearch by this code:

sqlContext.read()
    .format("org.elasticsearch.spark.sql")
    .load("events");

i get:

java.lang.ClassCastException: java.lang.String cannot be cast to java.sql.Timestamp

because my dataframe schema is:

StructField(collectionTimestamp,TimestampType,true)

it seems "es.mapping.date.rich" not change the dataFrame schema

@costin
Copy link
Member

costin commented Jan 26, 2016

Fixed in master. A nightly build has been pushed as well. Please try it out.

Thanks,

@arman1371
Copy link
Author

Fixed.
Thanks

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

No branches or pull requests

2 participants