Does Stargate rest api support LIMIT query in Cassandra (DSE 6.8)?
Select * from table LIMIT 100;
If any, can you provide me an example?
The Stargate REST API equivalent of LIMIT is the page-size query parameter documented here
https://stargate.io/docs/stargate/1.0/attachments/restv2.html#operation/getRows
Related
With OSS Stargate I can create a keyspace using
mutation createKsLibrary {
createKeyspace(name:"library", replicas: 1)
}
with Astra I get
"Exception while fetching data (/createKeyspace) : org.apache.cassandra.stargate.exceptions.UnauthorizedException: User has no CREATE permission on <all keyspaces> or any of its parents",
Although OSS Stargate does support keyspace creation, for Astra you'll actually need to use the UI for this. To do so you'll want to open your database and then scroll down and click the "Add Keyspace" button on the right hand side.
Add Keyspace
Docs:
https://docs.astra.datastax.com/docs/managing-keyspaces
https://docs.astra.datastax.com/docs/datastax-astra-guardrails
I am using Azure's SearchServiceClient to create indexer from my API. My data source for this indexer is a sql view which returns 2 million records and it is a long running query. On the call Indexers.CreateOrUpdateAsync to create indexer, I am getting this error - "the operation was canceled".
I tried adding 30 minute query timeout to indexer definition, but no luck. ({ "queryTimeout", "00:30:00" }. Reference -https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.search.models.indexingparameters.configuration?view=azure-dotnet#Microsoft_Azure_Search_Models_IndexingParameters_Configuration)no
The 'queryTimeout' parameter you are passing in looks correct, so it's possible you are hitting a timeout on the client side in the SDK rather than from the service. You should be able to configure the 'HttpClient' timeout on your SearchServiceClient to be longer. https://learn.microsoft.com/en-us/dotnet/api/microsoft.azure.search.searchserviceclient?view=azure-dotnet
You may also want to consider working to reduce your sql query time for best indexer performance.
What is the successor to this:
https://github.com/VeritoneAlpha/jaws-spark-sql-rest
?
It does not support Spark 2 version. Would like to pass query into curl request and get a response of the rows retrieved by the query in json format.
Apache Livy works well with Spark 2.3
In datastax driver we have api like
withTimestampGenerator(new AtomicMonotonicTimestampGenerator())
to enable the feature to setting timestamp per query at client side. How can we achieve same with spring data canssandra.
I am aware that i can use "USING TIMESTAMP value" in cql but is there something which spring data cassandra provide ? I dont find such api in CassandraClusterFactoryBean .
You are correct!
Unfortunately, it appears SD Cassandra is missing a configuration option on the CassandraCqlClusterFactoryBean class supporting the withTimestampGenerator(:TimestampGenerator) configuration setting with the DataStax Java driver Cluster.Builder API.
Equally unfortunate is there is no workaround (other than the USING TIMESTAMP in CQL) at the moment either.
It also appears the CassandraCqlClusterFactoryBean is missing configuration options for:
Cluster.Builder.withAddressTranslator(:AddressTranslator)
Cluster.Builder.withClusterName(:String)
Cluster.Builder.withCodeRegistry(:CodecRegistry)
Cluster.Builder.withMaxSchemaAgreementWaitSeconds(:int)
Cluster.Builder.withSpeculativeExecutionPolicy(:SpeculativeExecutionPolicy)
Though, beware, the withTimestampGenerator(..) is only supported in version 3 of the DataStax Java Driver, which the next version (i.e. 1.5.0) of SD Cassandra will support...
This feature is only available with version V3 or above of the native protocol. With earlier versions, timestamps are always generated server-side, and setting a generator through this method will have no effect.
The timestamp capability is available in SD 1.5.x,
public void setTimestampGenerator(TimestampGenerator timestampGenerator) {
this.timestampGenerator = timestampGenerator;
}
https://github.com/spring-projects/spring-data-cassandra/blob/cc4625f492c256e5fa3cb6640d19b4e048b9542b/spring-data-cassandra/src/main/java/org/springframework/data/cql/config/CassandraCqlClusterFactoryBean.java.
I am working on wso2 DSS 3.1.0 and inserting data as array into sql , this is Sql query
INSERT INTO memployeecount (CompanyCode,NoofEmployees) VALUES
('SPS', 1000),
('SPS', 2000),
('SPS', 3000),
('SFS', 500),
('SFS', 600),
('SFS', 700);
it's working fine,
But how can i write the same query for Data Service server.
Some one guide me.
WSO2 DSS supports batch requests, which takes of array of parameters as the input. What you need to do is create a dataservice enabling batch requests[1], with a simple insert query.
Once it is deployed there will be a batch enabled request created from which you can insert multiple records. For more information you can tryout Batch Processing sample available inside DSS[2].
[1]http://docs.wso2.org/display/DSS310/Creating+Using+Various+Data+Sources
[2]http://docs.wso2.org/display/DSS310/Batch+Processing+Sample