Member since
02-07-2017
12
Posts
1
Kudos Received
0
Solutions
03-21-2017
07:31 AM
@Dinesh Chitlangia brilliant! i will try this out. Thanks a lot!!
... View more
03-20-2017
08:22 AM
@Dinesh Chitlangia Exactly what i'm looking for....any ideas....
... View more
03-17-2017
07:53 AM
Hi @Dinesh Chitlangia . Yes I do use this. But i'm looking for a way to generate a series of dates using HiveQL
... View more
03-16-2017
03:42 PM
In SQL , for example, we can use the following: SELECT (to_date('01-12-2016','DD-MM-YYYY') - ROWNUM) AS DT FROM DUAL CONNECT BY ROWNUM <= 366 I tried uing the following in HiveQL which didnt work: SELECT (to_date('01-12-2016','DD-MM-YYYY') - ROW_NUMBER() OVER () AS row_num) AS DT FROM DUAL CONNECT BY row_num <= 366; Is there a way around this?
... View more
Labels:
- Labels:
-
Apache Hive
02-27-2017
08:02 AM
I was able to import all tables in the following format: sqoop import -connect jdbc:oracle:thin:@<fdqn>/<server> -username <username> -P -table CUST_NAV -columns "<column names separated by commas" -hive-import -hive-table databasenameinhive.New_CUST_NAV -target-dir 'location in hdfs' @bpreachuk I understood the workaround in my problem using your suggestion. I'll import all tables as is from the oracle db and create different views which i can then use in my select statements. Thanks guys.
... View more
02-20-2017
07:58 AM
Hi @Artem Ervits. Thanks for the reply. I had read on free from query imports but decided against it because we cannot use ANDs and ORs. I will however try and see what happens. I cant work on the second option you and @bpreachuk suggested as i dont have access to create tables/views in the RDBMS. So the way i'll go is try using the free form query. If that doesnt work i'll import the tables as is from the RDBMS and run complex queries using HIVE. I'll update you on how it goes.
... View more
02-17-2017
11:20 AM
1 Kudo
Hi, I found another way of doing this: 1. I first loaded my data set in HDFS. The data set contained the following columns: rwid, ctrname, clndrdate and clndrmonth. Note that column rwid had no values. 2. Then i created an external table that maps to this data set in hdfs CREATE EXTERNAL TABLE IF NOT EXISTS calendar(rwid int, ctrname string, clndrdate DATE, clndrmonth string )
COMMENT 'Calendar for Non Business Days'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS TEXTFILE
location '<location of my file in hdfs>'; 3. I created an ORC CREATE TABLE IF NOT EXISTS calendar_nbd(rwid int, ctrname string, clndrdate DATE, clndrmonth string )
COMMENT 'Calendar for Non Business Days'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS ORC; 4. The last step is most important. I used row_number() over() in the insert overwrite query. This automatically updated the rwid column with the row number.
insert overwrite table calendar_nbd
select row_number() over () as rwid, ctrname,clndrdate, clndrmonth from calendarnonbusdays;
... View more
02-17-2017
11:13 AM
I have 5 tables belonging to different schemas but have common fields. I need to perform a complex join to fetch data for analysis. I want to store the results in HIVE. Can I do this using sqoop?
... View more
Labels:
- Labels:
-
Apache Sqoop
02-09-2017
08:43 AM
@icocio Thank you
... View more
02-07-2017
06:59 AM
So will this work? ALTER TABLE HCALENDAR2017 ADD CONSTRAINT RWID_PK PRIMARY KEY (rowid() as rwid);
... View more