You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] field name with dot is missing in output without fields command #3477
changed the title [-][BUG] field name with `dot` is missing without `fields` command[/-][+][BUG] field name with `dot` is missing in output without `fields` command[/+]on Mar 25, 2025
Then I think it need to be supported from the core. It's required that mapping should support field name with dot, and when adding a document with such a field it should update mapping as well.
The current symbol resolution logic in ReferenceExpression attempts to resolve a nested field path (e.g., log.json.status) by recursively splitting the path and looking for child values in ExprValue map. It does not support the case where intermediate field names contain dots (e.g., "address.local" as a single field name). As a result, the resolution ends up with missing value because the logic expects "log" → "json" → "status", not "log.json" → "status".
🔸 Note: This issue is also present in the V3 engine, which shares the same recursive resolution logic. Code reference: OpenSearchIndexEnumerator
Solutions
🔹 Solution 1: Read from _source using recursive prefix matching
Implement logic similar to SourceLookup.extractValue() in OpenSearch core:
At each recursion step, attempt to join increasingly longer prefixes of the path (e.g., "log", "log.json", etc.) and match them against keys in the ExprValue map.
Cons: May introduce performance overhead due to repeated prefix enumeration and lookups at each level.
🔹 Solution 2: Read from _source into a flat map of full paths
When reading _source into ExprValue, flatten it into a map where each key is a full field path (e.g., "log.json.status") and resolve symbols by exact match.
Pros: Simple and efficient symbol resolution logic.
Cons: Only works for leaf value access (e.g., cannot access log.json as an object).
🔹 Solution 3: Read from doc_values instead of _source
Modify ExprValue factory to read directly from doc_values
Pros: Avoids dependency on _source; provides faster access for many use cases.
Cons: May have performance implications if too many fields are involved; not all field types (e.g., text, object) support doc_values.
Issues Related
Inconsistency between Describe Statement and Select * Expansion
The DESCRIBE command flattens all fields in the index mapping, including all prefixes for dotted field name:
@LantaoJin Thanks for the additional context! I've updated my comment here. My current testing shows that both V2 and V3 engines exhibit the same issue.
I think the main issue described is just one part of a broader problem. We need a comprehensive design to ensure consistent behavior when handling object fields in our core engine — including Describe index, SELECT *, SELECT with specific fields etc — considering the user experience in OpenSearch Dashboards and BI tool integrations (via SQL). cc: @penghuo@anasalkouz
Activity
[-][BUG] field name with `dot` is missing without `fields` command[/-][+][BUG] field name with `dot` is missing in output without `fields` command[/+]qianheng-aws commentedon Mar 25, 2025
It seems to be a bug(/feature?) of OpenSearch DSL instead of PPL.
The root cause is the document you put into this index mismatches its mapping.
In the mapping of index,
test.occupationis a nested field oftestwhile it is viewed as a root field in the document.The correct document content should be:
LantaoJin commentedon Mar 25, 2025
The correct document content should be:
Ah, I see. Thanks @qianheng-aws . Close this.
penghuo commentedon Mar 25, 2025
@LantaoJin @qianheng-aws
IMO, For PPL, ths issue is index mapping not match indexed source doc, then we can not parsed source data correcttly
field type
but data stored is
OpenSearch can read it correctlly actually.
qianheng-aws commentedon Mar 26, 2025
Then I think it need to be supported from the core. It's required that mapping should support field name with dot, and when adding a document with such a field it should update mapping as well.
penghuo commentedon Apr 9, 2025
Problems
Proposal
currently, index schema is
we could populate inner field instead
anasalkouz commentedon Apr 15, 2025
@LantaoJin @penghuo is this issue on track? is this will be fixed on 3.0?
dai-chen commentedon Apr 16, 2025
Root Cause
The current symbol resolution logic in
ReferenceExpressionattempts to resolve a nested field path (e.g.,log.json.status) by recursively splitting the path and looking for child values inExprValuemap. It does not support the case where intermediate field names contain dots (e.g., "address.local" as a single field name). As a result, the resolution ends up with missing value because the logic expects"log" → "json" → "status", not"log.json" → "status".Code reference: ReferenceExpression.java#L103
Solutions
🔹 Solution 1: Read from
_sourceusing recursive prefix matchingSourceLookup.extractValue()in OpenSearch core:"log","log.json", etc.) and match them against keys in theExprValuemap.XContentMapValues.java#L187
🔹 Solution 2: Read from
_sourceinto a flat map of full paths_sourceintoExprValue, flatten it into a map where each key is a full field path (e.g.,"log.json.status") and resolve symbols by exact match.log.jsonas an object).🔹 Solution 3: Read from
doc_valuesinstead of_sourceExprValuefactory to read directly fromdoc_values_source; provides faster access for many use cases.text,object) supportdoc_values.Issues Related
Inconsistency between Describe Statement and Select * Expansion
The
DESCRIBEcommand flattens all fields in the index mapping, including all prefixes for dotted field name:The
SELECT *expansion only retrieves top-level field name from the symbol table:LantaoJin commentedon Apr 17, 2025
Let me re-describe the issue:
User can ingest docs with different ways.
Approach 1
Approach 2
The mappings are same whatever by Approach 1 or Approach 2
The difference is that the docs have different _source
PPL results with full path, root path and partial path are all correct for the doc created by Approach 1. But incorrect by Approach 2.
Returns
Returns
Returns
The issue happens when users treat the nested/struct object in
log.jsonlevel instead of root level (log) in data ingestion?dai-chen commentedon Apr 17, 2025
@LantaoJin Thanks for the additional context! I've updated my comment here. My current testing shows that both V2 and V3 engines exhibit the same issue.
I think the main issue described is just one part of a broader problem. We need a comprehensive design to ensure consistent behavior when handling object fields in our core engine — including Describe index, SELECT *, SELECT with specific fields etc — considering the user experience in OpenSearch Dashboards and BI tool integrations (via SQL). cc: @penghuo @anasalkouz