Comments (7)
Hi @megastef
Thanks for raising the issue.
I quickly tested, but found out that both CREATE TABLE and CREATE BLOB TABLE do return the rows
property in the response json.
CREATE TABLE example
httpie POST http://127.0.0.1:4200/_sql stmt='create table foo (id integer, name string)'
HTTP/1.1 200 OK
Content-Length: 49
Content-Type: application/json; charset=UTF-8
{
"cols": [],
"duration": 142,
"rowcount": 1,
"rows": []
}
CREATE BLOB TABLE example
httpie POST http://127.0.0.1:4200/_sql stmt='create blob table my_blobs'
HTTP/1.1 200 OK
Content-Length: 49
Content-Type: application/json; charset=UTF-8
{
"cols": [],
"duration": 221,
"rowcount": 1,
"rows": []
}
Please let me know if I misunderstood the issue. What version of Crate to you use? Would be great if you could provide an example where it fails.
Best, Christian
from crate.
I digged again into "CREATE BLOB TABLE":
We send this to the _sql endpoint:
{"stmt":"CREATE BLOB TABLE blobtest clustered into ? shards with (number_of_replicas=?)","args":[1,3]}
We get back this:
{ error:
{ message: 'SQLActionException[line 1:43: mismatched input \'?\' expecting INTEGER_VALUE]',
code: 4000 },
rows: [] }
It happened in Version 0.40.4. Any advise? It looks the args are interpreted as string and not as number.
By the way: In this case "row count" is not set.
from crate.
hi @megastef,
the actual issue here is that the clustered into
clause does not accept a parameter.
Do you need a parameter to provide a value for the number of shards?
from crate.
Ok, I fixed it by generating a string and not passing parameters in in "args" array. So the node.js driver provides this function including shards and replicas since 1.0.8. Maybe you close this one and its up to you if you open a new issue for it.
Actually it looks now like this:
exports.createBlobTable = function createBlobTable(tableName, replicas, shards, cbf) {
var statement = "CREATE BLOB TABLE " + tableName + " clustered into " + shards + " shards with (number_of_replicas=" + replicas + ")";
// [shards, replicas]
executeSql(statement, [], cbf);
};
from crate.
Just merged a PR that will allow parameters in the clustered into clause: #1067
It will also be part of the next 0.41 bugfix release.
Is that row count isn't set still a problem or can I close the issue here?
from crate.
Thanks. You can close it - I guess the inital failure was as we introduced the shards/replicas. We can update the driver in the future to use the args again for create blob table, when we got the possibility to query CRATE version number. @chaudum showed that rowcount is present in case of success.
from crate.
Ok great so I am closing this.
Btw you can get the crate version if you do a GET request on the root '/' endpoint.
from crate.
Related Issues (20)
- Improve SQLParseException to include query and approximate position of the error. HOT 2
- COPY FROM does not work on all files inside folder HOT 10
- Vector Store: Provide distance functions as scalar functions HOT 3
- Support for CREATE TYPE HOT 5
- Unable to copy data between tables using the syntax: `INSERT INTO test2 (SELECT * FROM test)` HOT 5
- Docker image for 5.5.4 unavailable HOT 3
- Prepared Statements Incorrectly Storing Partition Information HOT 5
- Allow non-superusers to run ALTER TABLE REROUTE commands HOT 1
- ArrayIndexOutOfBoundsException in complex query HOT 3
- Disallow setting both balance.index and balance.shard factors to 0
- Improve primary shards balancing/reduce primary shard write overhead HOT 1
- Support `GROUP BY ALL` HOT 9
- Avoid adding unreleased file in EOL branches (maybe we need a custom plugin?) HOT 2
- Support Parquet as export file format for `COPY TO` HOT 2
- Insert into column with default value doesnt work "standalone" HOT 1
- Enable more flexible killing of jobs HOT 4
- schema_rename_replacement in RESTORE SNAPSHOT not working as expected with partitioned table HOT 2
- Allow referencing grandparent fields
- GRANT on unknown objects need to be rejected HOT 7
- Complex parametrized query takes an abnormal amount of time to execute HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crate.