I am using DSE version = 5.0.1 . Using Solr for Search activities. I created core successfully for particular table.
After that once I am trying to execute solr seach query , I am getting below issue :-
cqlsh:tradebees_dev> SELECT * FROM yf_product_books where solr_query = ':';
ServerError: <Error from server: code=0000 [Server error]
message="java.io.IOException:
No shards available for ranges: [(2205014674981121837,2205014674981121837]]">
Please suggest some solutions.
Your query should be something like this : -
SELECT * FROM yf_product_books where solr_query = ':';
Related
This is my Solr query: qt section: /select
q section: -nest_path:*
fl section: *, [child limit=-1]
Solr query
and I wanna convert this to Postman's form-data like " stmt: select id,title from TABLE_NAME where author_code is not null limit 100 " to reach same result.
If you execute your query from the Solr Admin web page you should see the corresponding URL that you will need for Postman at the top of the page
In this case the URL will be:
http://localhost:8983/solr/puldata/select?fl=*%2C%20%5Bchild%20limit%3D-1%5D&q=-nest_path%3A*
I am not sure your query is valid, though. But that would be a different issue.
I am trying to flatten an array using UNNEST function in the Table API.
Am I doing something wrong or it is not a supported function ? This page suggests it though: https://ci.apache.org/projects/flink/flink-docs-master/dev/table/sql/queries.html
Thanks !
Code
Python udf
#udf(input_types=DataTypes.STRING(), result_type=DataTypes.ARRAY(DataTypes.STRING()))
def explode(s):
return 3*[s]
t_env.register_function("explode", explode)
Processing
tab = t_env.from_path('mySource').select("id, explode(dummy) as dummy_list")
t_env.register_table("temp_table", tab)
t_env.sql_query("SELECT t.item as dummy_item FROM UNNEST(select dummy_list from temp_table) AS t(item)").insert_into("mySink")
Execution
t_env.execute("dummy_unnest")
Error
TableException: Cannot generate a valid execution plan for the given query:
LogicalProject(dummy_item=[$0])
Uncollect
LogicalProject(EXPR$0=[org$apache$flink$table$functions$python$PythonScalarFunction$908596b4671476ee325743dba92ed6c7($1)])
LogicalTableScan(table=[[default_catalog, default_database, mySource]])
This exception indicates that the query uses an unsupported SQL feature.
Please check the documentation for the set of currently supported SQL features.
I think you can change the query to
select id, dummy_item from temp_table CROSS JOIN UNNEST(dummy_list) AS t (dummy_item)
I am using Java-Hibernate with two Databases (Postgresql and MSSQL).
SqlServer2012 with dialect:
hibernate.dialect = org.hibernate.dialect.SQLServer2012Dialect
I have written a Criteria query like :
DetachedCriteria detachedCriteria=DetachedCriteria.forClass(entityClazz);
ProjectionList proj = Projections.projectionList();
proj.add(Projections.max(COMPOSEDID_VERSION_ID));
proj.add(Projections.groupProperty(COMPOSEDID_ID));
detachedCriteria.setProjection(proj);
criteria = session.createCriteria(entityClazz)
.add( Subqueries.propertiesIn(new String[] { COMPOSEDID_VERSION_ID, COMPOSEDID_ID }, detachedCriteria));
This query worked fine with Postgre Db. But when i switch to MSSQL i get the following error:
Caused by: java.sql.SQLException: An expression of non-boolean type specified in a context where a condition is expected, near ','.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:671)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:505)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:1029)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:70)[201:org.hibernate.core:5.0.0.Final]
Can anyone help me out? What change should i made in Criteria API to achieve my goal to get maxVersion record against each Id??
Instead of adding subqueries in criteria of projections from detached critaria, add projection directly in critaria like this:
DetachedCriteria detachedCriteria=DetachedCriteria.forClass(entityClazz);
ProjectionList proj = Projections.projectionList();
proj.add(Projections.max(COMPOSEDID_VERSION_ID));
proj.add(Projections.groupProperty(COMPOSEDID_ID));
criteria = session.createCriteria(entityClazz)
.setProjection( proj );
I executed the query like this in razor sql.
SELECT * FROM number_log where phonenumber = '6032969081' and is_active='1' ALLOW FILTERING
Its giving me an error like -
ERROR: No secondary indexes on the restricted columns support the
provided operators: 'SELECT * FROM number_log
where phonenumber = '6032969081' and is_active='1' ALLOW FILTERING'
can anyone please help me out -
Try to add an index on your column....
CREATE INDEX ON <b>table_name</b> (<b>field_name</b>);
check this out....It can help you about your issue.
http://tonylixu.blogspot.in/2015/04/cassandra-no-secondary-indexes-on.html
I am trying to use PreparedStatement with solr_query using the following code:
PreparedStatement preparedStatement = cassandraSession.prepare(
"SELECT * FROM users WHERE solr_query = 'username:? OR email:?';"
);
BoundStatement boundStatement = new BoundStatement(preparedStatement);
ResultSet results = cassandraSession.execute(
boundStatement.bind(
username,
email
)
);
When I execute the code above, I am getting the following exception:
java.lang.IllegalArgumentException: Prepared statement has only 0 variables, 2 values provided
How can I use prepared statements with solr_query properly?
I am using DataStax Enterprise 4.5.3 which uses Cassandra 2.0.11.82 and Solr 4.6.0.2.8. I am using the DataStax Java driver.
Sorry, but CQL does not support variable substitution within string constants, only for a complete string constant. The Solr query string is parsed again on every SELECT statement execution anyway, so having the Solr query string "prepared" would save no overhead, so you should simply supply the entire Solr query string as a prepared statement variable, as in "WHERE solr_query = ?".