Reputation: 2076
SnappyData v.0.5
I cannot seem to create row tables for a specific schema. This is important in a schema-based multi-tenant application where each tenant has his own schema.
However, when I create my tables using RowStore DDL, they are queryable is all schemas for the DB.
Here were my steps. Did I do something wrong?
ubuntu@ip-172-x-x-x:~$ snappy-shell
SnappyData RowStore 1.5.0 GA
snappy> connect client '172.x.x.x:1527';
Using CONNECTION0
**snappy> set schema A;**
0 rows inserted/updated/deleted
snappy> run '/home/ubuntu/data/ddl/create_row_tables.sql';
snappy> DROP TABLE IF EXISTS road;
0 rows inserted/updated/deleted
snappy>
CREATE TABLE road
(
road_id VARCHAR(64) NOT NULL,
name VARCHAR(64) NOT NULL,
CONSTRAINT road_PK PRIMARY KEY (road_id)
)
PERSISTENT;
0 rows inserted/updated/deleted
In DBVisualizer using JDBC, I have the following schemas: A, APP, NULLID, Q, SQLQ, etc. When I change DBVisualizer to point to a specific schema, and run:
select * from road;
The query returns zero rows on ALL SCHEMAS. I would expect a 'Table not found:ROAD;' error on all schemas except "A". What do I need to do to create the tables only on a specific schema?
Upvotes: 1
Views: 62
Reputation: 383
The schema integration of the store with Spark metadata had some issues which have been fixed in recent builds. As of the released version, you will need to use fully qualified names like:
create table a.road ...
select * from a.road
Btw, if you run the cluster as a pure rowstore (using "snappy-start-all.sh rowstore"), then schema should work as expected.
Upvotes: 1