Use Crate SQL module(plugin) in Elasticsearch - sql

I am using Elasticsearch on linux sever but Quering is a little bit difficult
because form of query is not SQL structure.
In crate, there is a sql plugin, so I put this plugin into my own Elasticsearch
Is it possible?
If not, how can I adopt Crate SQL Plugin into Elasticsearch?
Thanks

Jehyun:
Crate has evolved from being an Elasticsearch plugin to a complete software stack. I don't believe that you can simply add a plugin to Elasticsearch to gain SQL-like queries. You would need to transition your cluster to Crate in order to use SQL queries.
Of course, you should test this process on a non-production system first.

Related

Java Sql Generate for Elasticsearch Sql

Is there any java library to build sql queries based on pojos,
Like something similar to hibernate hql queries.
Object sql queries than translated to elastic search sql queries.
Current requirement is to send sql queries through rest apis.
There is jooq library whic can generate for many databases using dialects but currently it doesnt support for EsDriver which is elastic search jdbc driver.
Regards
Rajesh Giriyappa
I find your question a bit confusing. however, I'm gonna mention some facts that might help you.
First of all, elasticsearch is far away from a relational database system. It is a search engine implemented on top of Apache Lucene and stores semi-structured documents in its own data structure called index and it is used for Information Retrieval purposes. having said that, it is impossible to run SQL queries against elasticsearch because obviously it is not an RDBMS.
Furthermore, JPA is targeted only for providing solutions for working with RDBMSs so you can not connect to elasticsearch with JDBC, Hibernate etc.
If you want to connect to elasticsearch in a java application, you should use standard clients provided by elasticsearch itself.
https://www.elastic.co/guide/en/elasticsearch/client/java-rest/7.13/index.html

How to access the Impala Parser

Does Impala reuse hive SQL parser?
I am trying to write a custom Java code to check for query correctness in my application. I am searching for an api which can consume the sql query and let me know if it is grammatically correct for impala.
How can I access the parser from a custom Java code to check for query compatibility?
No, Impala does not reuse the Hive parser.
Further, Impala does not expose a Java API for checking if a query is grammatically correct.
The easiest thing to do is probably to submit an explain query via JDBC and check the result.
If you don't have a running Impala cluster, in theory you should be able to instantiate the scanner and parser as Impala does in the parser unit tests, but I can imagine it might be difficult to get that working as the Impala build/test environment is quite complicated. Note that this is not a supported API.

Can I combine querydsl-jpa and querydsl-sql to create incremental changes to the underlying database?

We have an ongoing project in which we use querydsl-jpa to make the queries.
When we deploy a new version of the product, it auto-executes sql file scripts to update the tables before starting hibernate. This scripts are just sql strings manually crafted (and very error prone).
I would like to use querydsl-sql to write the migration scripts programmatically and once that's done, use querydsl-jpa for normal ORM querying.
So the question is, if anyone knows if they can live together in the same project? And if anyone has done that before?
Using Querydsl JPA and SQL in a project together is a very common use case. You can for example use the JPA API and Querydsl JPA for CRUD use cases and Querydsl SQL for queries.
Querydsl SQL doesn't support DDL scripts (CREATE, ALTER etc). So that part is not covered by Querydsl.

Is there a better tool to visually see Apache Derby tables then the Eclipse DB perspective?

I am using the Eclipse Juno Database Development view to view my tables in my Apache Derby v.10.9.1.0 database. This works ok. I can see the tables in my Schema in the folders. I really want to be able to sort my tables results, change values and update without using the SQL scrapbook etc. I know this sounds crazy but I really liked Oracle SQL developer. I know they don't support Derby. Is there a better free tool than the Eclipse Database Development perspective? Should I just learn to love sql?
I like SquirrelSQL, which supports schema inspection, sql statement execution, sorting of results, updating, etc.: http://squirrel-sql.sourceforge.net/
There is also dbvisualizer. It's quite nice. If you're running Derby in embedded mode using a program like squirrel dbvis can be problematic though. Because only one JVM can 'mount' the database at a time, which it means either your app or the view app can access it at a time. This gets annoying pretty quickly.
If you're running over the network driver though it's no problem.

"Light" serverless SQL engine with T-SQL language access

I would like to create integration tests for a program that will be connected to a SQL Server in production.
But I would like the unit tests to be shippable and loadable without the need for a running SQL Server...
I am willing to write a stub to adapt to the alternating SQLServer / "Light SQL for tests"
I would like to keep the existing T-SQL queries as they are. Not change a single dot in them.
Would you kindly suggest an option ?
Unless you use advanced T-SQL features, SQL CE ought to be enough.