Skip to content

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.

2 participants