[
https://issues.apache.org/jira/browse/CASSANDRA-2474?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13047313#comment-13047313
]
Jonathan Ellis commented on CASSANDRA-2474:
-------------------------------------------
bq. Details of the current CF mapping in hive for static vs dynamic columns is
here:
No, that really doesn't give me details at all. All that tells me is that I
can use magic, hard-coded column names to support wide rows _with no
subcolumns_. (I assume subcolumns are supported too but this does not tell me
now.)
bq. I don't see what is so bad about mapping each column and subcolumn so its
own row like the Cassandra Hive driver does today.
Because that ignores that the columns actually have structure of their own.
Let's extend your example with another column:
key1: { col1: {subcol1:val1, subcol2: val2}, col2: {subcol1: v3, subcol2: v4} }
We want to map the key1 row as a non-sparse table:
{noformat}
key subcol1 subcol2
col1 val1 val2
col2 v3 v4
{noformat}
The "N columns with M subcolumns become N*M mapped rows" makes getting real
resultsets of columns-from-a-single "subrow" impossible, which has real impact
on how you work with the data: how would you query for "all subrows[columns]
where subcol1=v3" with the N*M model? You can't, because you've destroyed the
connection between subcolumns in the same parent column.
(This is the same reason people always regret saying "I know, I'll bypass the
problems of having to do ALTER TABLE in mysql by creating a table that has two
columns, key and value.")
Note that the :bar notation allows dealing with dynamic, sparse subcolumns as
well: but only within a single parent at a time, unless you do something like
the UNION you propose. Which comes back to my original argument that this is
the right level of granularity for the API to encourage, or you've screwed up
your data model.
> CQL support for compound columns
> --------------------------------
>
> Key: CASSANDRA-2474
> URL: https://issues.apache.org/jira/browse/CASSANDRA-2474
> Project: Cassandra
> Issue Type: Sub-task
> Components: API, Core
> Reporter: Eric Evans
> Labels: cql
> Fix For: 1.0
>
>
> For the most part, this boils down to supporting the specification of
> compound column names (the CQL syntax is colon-delimted terms), and then
> teaching the decoders (drivers) to create structures from the results.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira