1

I have created hbase table using SQuirrel SQL client 3.6. Below is query I tried-

create table test (mykey integer not null primary key, mycolumn varchar);
upsert into test values (1,'Hello');
upsert into test values (2,'World!');

Now I am trying to create view using SQuirrel SQL client 3.6. Below is query I tried-

create view "TEST" (ID BIGINT NOT NULL PRIMARY KEY, "TEST".mycolumn varchar);

This create view query returns below error-

Error: ERROR 505 (42000): Table is read only.
SQLState:  42000
ErrorCode: 0

Please suggest what is issue..

S Singh
  • 1,403
  • 9
  • 31
  • 47
  • I see you created table "test" but refer to it in the view as "TEST" (uppercase instead of lowercase). Could this just be a matter of case sensitivity? Try changing "TEST" to "test" where "TEST".mycolumn is and see what happens. – dunce1 Mar 26 '15 at 17:17
  • @dunce1 I don't think so, thanks for suggestion. I will try it later. – S Singh Apr 01 '15 at 08:38

1 Answers1

0

This error is thrown because of the name of the view. Phoenix converts these names as uppercase if not given in double quotes. So you need to be careful while writing the table or column name.

"test" and "TEST", both are considered different in this case.

In the above query, view name will be "test" and "myColumn" should be given in double quotes.

create view "test" (ID BIGINT NOT NULL PRIMARY KEY, "test"."mycolumn" varchar);
Nishu Tayal
  • 20,106
  • 8
  • 49
  • 101