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

[Transform] Can not group_by on field alias #46694

Closed
hendrikmuhs opened this issue Sep 13, 2019 · 1 comment · Fixed by #46703
Closed

[Transform] Can not group_by on field alias #46694

hendrikmuhs opened this issue Sep 13, 2019 · 1 comment · Fixed by #46703

Comments

@hendrikmuhs
Copy link
Contributor

found by @wwang500

If group_by or certain aggregations use field aliases the mapping deduction does not resolve the alias to a concrete type but tries to create another alias in the destination index. As a result of wrong deduction the transform will fail on start when trying to create the destination index, see error below.

Workaround 1: Use the concrete fieldname instead of the alias
Workaround 2: Create the destination index manually

Solution: Deduction should use the proper type. The get mapping api does not support resolving the type, however field caps resolve the type correctly.

The wip PR for CCS support has a fix (so using field caps is the way to go for other reasons as well):

https://github.com/elastic/elasticsearch/pull/46075/files#diff-cbb75ff448d44acf01292ad7a635b22a

I suggest we cut out the mapping deduction change from this PR (@benwtrent)

Error:

{
  "error": {
    "root_cause": [
      {
        "type": "runtime_exception",
        "reason": "Could not create destination index [t2] for transform [t2]"
      }
    ],
    "type": "runtime_exception",
    "reason": "Could not create destination index [t2] for transform [t2]",
    "caused_by": {
      "type": "mapper_parsing_exception",
      "reason": "Failed to parse mapping [_doc]: The [path] property must be specified for field [hostname].",
      "caused_by": {
        "type": "mapper_parsing_exception",
        "reason": "The [path] property must be specified for field [hostname]."
      }
    }
  },
  "status": 500
}
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core

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

Successfully merging a pull request may close this issue.

3 participants