elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
69.61k stars 24.63k forks source link

SQL: selecting a nested or an object field return as a json string #99414

Open alisanguo opened 1 year ago

alisanguo commented 1 year ago

Description

Currently, selecting a nested or an object field using es sql will return a result that looks a little strange: 1.if an obejct field with enable=false,it will not be retrieved 2.if an obejct field(test_field) with enable=true, we execute sql: "select test_field from test_index limit 1" it returns: {"error":{"root_cause":[{"type":"verification_exception","reason":"Found 1 problem(s)\nline 1:8: Cannot use field [fee_rate] type [object] only its subfields"}],"type":"verification_exception","reason":"Found 1 problem(s)\nline 1:8: Cannot use field [fee_rate] type [object] only its subfields"},"status":400

I think that it should return a json string like using DSL query,or as a option at least.

elasticsearchmachine commented 1 year ago

Pinging @elastic/es-ql (Team:QL)

elasticsearchmachine commented 8 months ago

Pinging @elastic/es-analytics-geo (Team:Analytics)