Skip to content

sql Customise function  #103

Open
Open
@robocon20x

Description

@robocon20x

Hi guys, i want to translate this SQL to DSL, how can I convert it ?:
SQL:
Select case when name = 'A' then 'NO' else 'YES' end as test from index_table

in java app, I code like this :
String sql = "Select case when name = 'A' then 'NO' else 'YES' end as test from index_table"; // sql = sql.replace("\"",""); ElasticSql2DslParser a = new ElasticSql2DslParser(); ElasticSqlParseResult b = a.parse(sql); // System.out.println(JsonUtil.toJson(b,ElasticSqlParseResult.clasSELECT name.exact as test from v3_customers_33167s)); SearchRequest c = b.getSearchRequest(); // b.toPrettyDsl(c); // System.out.println(JsonUtil.toJson(c,SearchRequest.class)); System.out.println(b.toPrettyDsl(c));

    Thanks and best regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions