Member since
04-19-2017
6
Posts
0
Kudos Received
0
Solutions
05-24-2017
05:10 PM
hive tables having different date formats (yyyyddmm:h:m:s and mm/dd/yyyy) I need to convrt into one format i.e. (yyyyddmm). i Have written the code but its not working.
... View more
05-24-2017
02:01 PM
Thanks it's clear but my scenario is different.
... View more
05-24-2017
10:59 AM
how can I achieve using Python
... View more
Labels:
- Labels:
-
Apache Hive
05-19-2017
05:29 AM
input1:create external table db.emp(id int,name string)
row formatted fields terminated by ','
location 'hadfs:.../';
create external table db.emp1(id int,name string)
row formatted fields terminated by ','
location 'hadfs:.../';
input2:create external table db.emp(id int,name string)
row formatted fields terminated by ','
location 'hadfs:.../';;
create table db.emp1(id int,name string)
row formatted fields terminated by ','
location 'hadfs:.../';
requeried output:create external table db.emp(id int,name string)
row formatted fields terminated by ','
location 'hadfs:.../';
create external table db.emp(id int,name string)
row formatted fields terminated by ','
location 'hadfs:.../';
these two files stored under file1.hql
******
create external table db.emp1(id int,name string)
row formatted fields terminated by ','
location 'hadfs:.../';
create external table db.emp(id int,name string)
row formatted fields terminated by ','
location 'hadfs:.../';
these two files stored under file2.hql and so on i tried with:
filenames = ['in1.txt', 'in2.txt']
with open('result.txt', 'w') as outfile:
for fname in filenames:
with open(fname) as infile:
content = infile.read().replace('\n', '')
outfile.write(content) but i didn't get requeried output. Please give me a hint how to achieve this.
... View more
- Tags:
- python