Hello,

I'm testing Phoenix 4.10 on HBase 1.2.5 and I'm confused about some behavior of dynamic columns.

I am seeing different behavior with views than this post <https://lists.apache.org/thread.html/a3f16f3fd0c125775b48e7f8bab3af161fe3d6c2a0b1a9635780b49e@1456433748@%3Cuser.phoenix.apache.org%3E> which use Phoenix 4.7. I expected to be able to see the value for "page_title" in the view, but it is blank unless I UPSERT directly into the view:

0: jdbc:phoenix:localhost> create table TMP_SNACKS(k bigint primary key, c1 varchar);
No rows affected (1.304 seconds)

0: jdbc:phoenix:localhost> upsert into TMP_SNACKS(k, c1, "page_title" varchar) values(1,'a','b');
1 row affected (0.048 seconds)

0: jdbc:phoenix:localhost> select * from TMP_SNACKS;
+----+-----+
| K  | C1  |
+----+-----+
| 1  | a   |
+----+-----+
1 row selected (0.039 seconds)

0: jdbc:phoenix:localhost> select * from TMP_SNACKS("page_title" varchar);
+----+-----+-------------+
| K  | C1  | page_title  |
+----+-----+-------------+
| 1  | a   | b           |
+----+-----+-------------+
1 row selected (0.061 seconds)

0: jdbc:phoenix:localhost> create view MY_VIEW("page_title" varchar) as select * from TMP_SNACKS;
No rows affected (0.11 seconds)

0: jdbc:phoenix:localhost> select * from MY_VIEW;
+----+-----+-------------+
| K  | C1  | page_title  |
+----+-----+-------------+
| 1  | a   |             |
+----+-----+-------------+
1 row selected (0.056 seconds)

Unexpected ---^

0: jdbc:phoenix:localhost> upsert into TMP_SNACKS(k, c1, "page_title" varchar) values(2,'a','c');
1 row affected (0.008 seconds)

0: jdbc:phoenix:localhost> select * from MY_VIEW;
+----+-----+-------------+
| K  | C1  | page_title  |
+----+-----+-------------+
| 1  | a   |             |
| 2  | a   |             |
+----+-----+-------------+
2 rows selected (0.048 seconds)

Unexpected ---^

0: jdbc:phoenix:localhost> upsert into MY_VIEW(k, c1, "page_title") values(3,'b','c');
1 row affected (0.009 seconds)

0: jdbc:phoenix:localhost> select * from MY_VIEW;
+----+-----+-------------+
| K  | C1  | page_title  |
+----+-----+-------------+
| 1  | a   |             |
| 2  | a   |             |
| 3  | b   | c           |
+----+-----+-------------+
3 rows selected (0.058 seconds)

Unexpected ---^

0: jdbc:phoenix:localhost> select * from TMP_SNACKS("page_title" varchar);
+----+-----+-------------+
| K  | C1  | page_title  |
+----+-----+-------------+
| 1  | a   | c           |
| 2  | a   | c           |
| 3  | b   |             |
+----+-----+-------------+
3 rows selected (0.048 seconds)

Unexpected ---^


Is this the expected behavior for dynamic columns with views?


Thanks!

--

Dave

Reply via email to