Execute sql queries in elassandra [elastic search]

Hi, I am using Elassandra [Combination of Elasticsearch + Cassandra], I want to execute sql queries in Elasticsearch, But I am getting one exception. I gone inside the elassandra pod,
tried this cmd

`curl -XPOST http://localhost:9200/indexalarm/_sql?format=txt -H 'Content-Type: application/json' -d '{"query": "SELECT * FROM tl1_active"}'

here indexalarm is a index name and tl1_active is a table name created in cassandra.

Following is the response I got

{"error":{"root_cause":[{"type":"runtime_exception","reason":"InvalidTypeNameException[Document mapping type name can't start with '_', found: [_sql]]"}],"type":"runtime_exception","reason":"InvalidTypeNameException[Document mapping type name can't start with '_', found: [_sql]]","caused_by":{"type":"invalid_type_name_exception","reason":"Document mapping type name can't start with '_', found: [_sql]"}},"status":500}

Can anyone please help where I am going wrong?

Thanks

I suppose this is an Elassandra specific problem and it is better to ask somewhere about Elassandra.

Though I'm not familiar with Elassandra, as for Elasticsearch SQL API, /index_name/_sql?... is not a valid Elasticsearch API request. In Elasticsearch, you have to use _sql?... only and set index name in FROM clause.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.