Is it possible to import data from Cassandra into Apache Solr?
I am currently importing data from MySQL into Apache Solr using Solr's dataimporthandler. Is it possible to use Cassandra in place of MySQL?
Update 1:
I tried to connect to Cassandra from a simple Java program using the JDBC driver given here (https://code.google.com/a/apache-extras.org/p/cassandra-jdbc/). My idea was, if the java code works, Solr should also be to import from Cassandra. But it didn't work and I got the following error:
log4j:WARN No appenders could be found for logger (org.apache.cassandra.cql.jdbc.CassandraDriver).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/cassandra/cql/jdbc/AbstractJdbcType
at org.apache.cassandra.cql.jdbc.CassandraConnection.(CassandraConnection.java:146)
at org.apache.cassandra.cql.jdbc.CassandraDriver.connect(CassandraDriver.java:92)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:270)
at CqlConnection.main(CqlConnection.java:14)
Caused by: java.lang.ClassNotFoundException: org.apache.cassandra.cql.jdbc.AbstractJdbcType
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 5 more
Disclaimer - Never tried this, so cannot vouch for performance etc :)
Solr's DataImportHandler contrib uses JDBC to connect to a relational data source. Here is the official Solr Wiki about configuring JDBC
Now, for Cassandra, you could use the Cassandra-jdbc driver and setup your DIH config to have SQL that this driver supports.
Please note:
- I have not used Cassandra-jdbc in a production setup, so there might be shortcomings that you may want to consider piloting on.
- As mentioned above, I do not know the performance aspect as well - will recommend you spike it out.
Please post back any findings!
Related
Using Snowflake JDBC driver version 3.11.1 we get below error on big-endian platforms.
We are observing an issue with latest Snowflake JDBC driver where even basic Select queries are failing with below exception. It used to work with earlier version 3.10.3. It seems issue with "Arrow" . Any plans of fixing this issue. Caused by: java.lang.IllegalStateException: Arrow only runs on LittleEndian systems. at net.snowflake.client.jdbc.internal.io.netty.buffer.UnsafeDirectLittleEndian.(UnsafeDirectLittleEndian.java:65) at net.snowflake.client.jdbc.internal.io.netty.buffer.UnsafeDirectLittleEndian.(UnsafeDirectLittleEndian.java:50) at net.snowflake.client.jdbc.internal.io.netty.buffer.PooledByteBufAllocatorL.(PooledByteBufAllocatorL.java:50) at net.snowflake.client.jdbc.internal.apache.arrow.memory.AllocationManager.(AllocationManager.java:53) snowflake-da
There is no way to disable Arrow for Snowflake clients. I would suggest you to use an earlier version of the JDBC driver (e.g. 3.9.x) to workaround it for the moment and contact Snowflake Support to explore your options moving forward.
Have you tried using the following alter session commands using latest snowflake driver on AIX environment?
ALTER SESSION SET JDBC_QUERY_RESULT_FORMAT='JSON'
Reference: https://community.snowflake.com/s/article/SAP-BW-Java-lang-NoClassDefFoundError-for-Apache-arrow
We are observing an issue with latest Snowflake JDBC driver where even basic Select queries are failing with below exception. It used to work with earlier version 3.10.3. It seems issue with "Arrow" . Any plans of fixing this issue.
Caused by: java.lang.IllegalStateException: Arrow only runs on LittleEndian systems.
at net.snowflake.client.jdbc.internal.io.netty.buffer.UnsafeDirectLittleEndian.(UnsafeDirectLittleEndian.java:65)
at net.snowflake.client.jdbc.internal.io.netty.buffer.UnsafeDirectLittleEndian.(UnsafeDirectLittleEndian.java:50)
at net.snowflake.client.jdbc.internal.io.netty.buffer.PooledByteBufAllocatorL.(PooledByteBufAllocatorL.java:50)
at net.snowflake.client.jdbc.internal.apache.arrow.memory.AllocationManager.(AllocationManager.java:53)
snowflake-da
After create Solr interpreter then trying to query collection through zookeeper, however it is throwing Exception Caused by: org.noggit.JSONParser$ParseException:
are you trying to look at this directly? you can go via the jdbc service it wasn't too complicated
https://lucene.apache.org/solr/guide/7_7/solr-jdbc-apache-zeppelin.html
When I want to make an insert I get this error. I'm using the Grails version ... can it be that I'm missing something? Thank you!
2019-03-08 09:08:56,705 [http-bio-8090-exec-20] ERROR events.PatchedDefaultFlushEventListener - Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at ar.com.mlan.api.PdCController$_save_closure2.doCall(PdCController.groovy:201)
at ar.com.mlan.api.PdCController.save(PdCController.groovy:161)
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
at grails.plugin.springsecurity.rest.RestTokenValidationFilter.processFilterChain(RestTokenValidationFilter.groovy:118)
at grails.plugin.springsecurity.rest.RestTokenValidationFilter.doFilter(RestTokenValidationFilter.groovy:84)
at grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter.doFilter(GrailsAnonymousAuthenticationFilter.java:53)
at grails.plugin.springsecurity.rest.RestAuthenticationFilter.doFilter(RestAuthenticationFilter.groovy:143)
at grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter.doFilter(MutableLogoutFilter.java:82)
at com.brandseye.cors.CorsFilter.doFilter(CorsFilter.java:82)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
ConstraintViolationException … so check the constraints on your domain object versus the data you are trying to save.
Hello I am developing a web application using Oracle ADF. Am using jdeveloper12c. I have created a view criteria for a view object as shown below in 12c.
After creating the view criteria am trying to drop this onto a a.jsf page as a ADF Query Panel. When I am trying to run this page I am getting the following error.
javax.servlet.ServletException: Servlet execution threw an exception
oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:192)
oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:105)
java.lang.NoClassDefFoundError: org/codehaus/groovy/control/customizers/CompilationCustomizer
oracle.jbo.ExprEval$ScriptLibrary.createShell(ExprEval.java:2534)
oracle.jbo.ExprEval$ScriptLibrary.getShell(ExprEval.java:2475)
oracle.jbo.ExprEval.parseScript(ExprEval.java:1571)
oracle.jbo.ExprEval.findScript(ExprEval.java:1152)
oracle.jbo.ExprEval.doEvaluate(ExprEval.java:1956)
oracle.jbo.ExprEval.doEvaluate(ExprEval.java:1928)
root cause
java.lang.ClassNotFoundException: org.codehaus.groovy.control.customizers.CompilationCustomizer
java.net.URLClassLoader$1.run(URLClassLoader.java:366)
java.net.URLClassLoader$1.run(URLClassLoader.java:355)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:354)
java.lang.ClassLoader.loadClass(ClassLoader.java:425)
java.lang.ClassLoader.loadClass(ClassLoader.java:358)
oracle.jbo.ExprEval$ScriptLibrary.createShell(ExprEval.java:2534)
oracle.jbo.ExprEval$ScriptLibrary.getShell(ExprEval.java:2475)
oracle.jbo.ExprEval.parseScript(ExprEval.java:1571)
oracle.jbo.ExprEval.findScript(ExprEval.java:1152)
oracle.jbo.ExprEval.doEvaluate(ExprEval.java:1956)
oracle.jbo.ExprEval.doEvaluate(ExprEval.java:1928)
I have successfully created view criteria and used in jdeveloper11.1.2.4.
Please help me with this problem.
Thanks in advance.
According to compatibility matrix, you need Tomcat 7 for running ADF 12c applications:
http://www.oracle.com/technetwork/developer-tools/jdev/documentation/1212-cert-1964670.html