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

fix issuse https://github.com/NLPchina/elasticsearch-sql/issues/265#i… #271

Merged
merged 1 commit into from Aug 25, 2016

Conversation

allwefantasy
Copy link
Member

Fix Issue :

https://github.com/NLPchina/elasticsearch-sql/issues/265#issuecomment-242388650

Unit test

org.nlpcn.es4sql.SqlParserTests.aggFieldWithAliasTableAliasShouldBeRemoved

Example

select count(t.*) as counts,sum(t.size) from xxx/locs as t group by t.kk

will be translate to

{
  "from" : 0,
  "size" : 0,
  "_source" : {
    "includes" : [ "COUNT", "SUM" ],
    "excludes" : [ ]
  },
  "aggregations" : {
    "kk" : {
      "terms" : {
        "field" : "kk",
        "size" : 200
      },
      "aggregations" : {
        "counts" : {
          "value_count" : {
            "field" : "_index"
          }
        },
        "SUM(size)" : {
          "sum" : {
            "field" : "size"
          }
        }
      }
    }
  }
}

@satapsa
Copy link

satapsa commented Aug 25, 2016

what will be the sql plugin version for this ?

@allwefantasy
Copy link
Member Author

version 2.3.5. But my pr is merged to master.

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

Successfully merging this pull request may close these issues.

None yet

2 participants