Lesson 1:
MapR Drill - Lesson 1drill:> show databases;
------------------------------------------------------------------
Enable the DECIMAL Data Type
This tutorial uses the DECIMAL data type in some examples. The DECIMAL data type is disabled by default in this release, so enable the DECIMAL data type before proceeding:alter session set `planner.enable_decimal_data_type`=true; ------------------------------------------------------------------
describe hive.nextgen_rjr.transaction_line_items |
Lesson 2:
MapR Drill - Lesson 2select cast(row_key as
int
)
, regexp_replace(cast(t.address.state as varchar(
10
)),
'"'
,
''
)
from customers t limit
1
;
A mutable (or writable) workspace is a workspace that is enabled for “write” operations. This attribute is part of the storage plugin configuration. You can create Drill views and tables in mutable workspaces.
-----------------------------------------------------------------
create or replace view custview as select cast(row_key as
int
) as cust_id,
cast(t.personal.name as varchar(
20
)) as name,
cast(t.personal.gender as varchar(
10
)) as gender,
cast(t.personal.age as varchar(
10
)) as age,
cast(t.address.state as varchar(
4
)) as state,
cast(t.loyalty.agg_rev as dec(
7
,
2
)) as agg_rev,
cast(t.loyalty.membership as varchar(
20
)) as membership
from maprdb.customers t;
A view is simply a special file with a specific extension (.drill). You can store views even in your local file system or point to a specific workspace
------------------------------------------------------------------
!set maxwidth
10000 -- can't get to work
------------------------------------------------------------------
No comments:
Post a Comment