Beispiel #1
0
def main():
    hr = HiveRuntime()
    s = getSchema()
    schema_a = ",".join(s[0])
    schema_b = ",".join(s[1])
    columns =  ",".join((schema_a,schema_b))
    write_Main_hql(columns)
#   print ",".join(s[1])
    hr.execute("main.hql")
    print("Done")
Beispiel #2
0
def main():
    hr = HiveRuntime()
    
    hdfs_input_dir =  hr.settings.Input.input_dir.val
    hdfs_input_dir =  os.path.join(hdfs_input_dir,'')
    
    output_dir = hr.get_hdfs_working_dir("output_dir")
    output_dir =  os.path.join(output_dir,'')
    output_filename = os.path.join(output_dir, "merged_file")
    
    hadoop_del_dir  = "hadoop fs -rm -r %s " % output_dir
    print hadoop_del_dir
    ret = cmd(hadoop_del_dir)
    print "prepare(delete output dir successfully)"

    hadoop_shell = "hadoop fs -mkdir %s && hadoop fs -text %s/* | hadoop fs -put - %s" %(output_dir,hdfs_input_dir,output_filename)
    print hadoop_shell
    ret = cmd(hadoop_shell)
    if ret !=0:
        sys.exit(ret)
    hr.settings.Output.output_file.val = output_filename

    print("Done")
Beispiel #3
0
def main():
    hr = HiveRuntime()

    hdfs_input_dir = hr.settings.Input.input_dir.val
    hdfs_input_dir = os.path.join(hdfs_input_dir, '')

    output_dir = hr.get_hdfs_working_dir("output_dir")
    output_dir = os.path.join(output_dir, '')
    output_filename = os.path.join(output_dir, "merged_file")

    hadoop_del_dir = "hadoop fs -rm -r %s " % output_dir
    print hadoop_del_dir
    ret = cmd(hadoop_del_dir)
    print "prepare(delete output dir successfully)"

    hadoop_shell = "hadoop fs -mkdir %s && hadoop fs -text %s/* | hadoop fs -put - %s" % (
        output_dir, hdfs_input_dir, output_filename)
    print hadoop_shell
    ret = cmd(hadoop_shell)
    if ret != 0:
        sys.exit(ret)
    hr.settings.Output.output_file.val = output_filename

    print("Done")
Beispiel #4
0
def main():
    hr = HiveRuntime()
    hr.execute("main.hql")
    print("Done")
Beispiel #5
0
def main():
    hr = HiveRuntime()
    write_Main_hql()
    hr.execute("main.hql")
    print("Done")
Beispiel #6
0
def main():
    hr = HiveRuntime()
    select_items = getSchema()
    write_Main_hql(select_items)
    hr.execute("main.hql")
    print("Done")
Beispiel #7
0
def main():
    hr = HiveRuntime()
    select_items = getSchema()
    write_Main_hql(select_items)
    hr.execute("main.hql")
    print("Done")
Beispiel #8
0
def main():
    hr = HiveRuntime()
    hr.execute("main.hql")
    hr.settings.Output.output_table2.val = hr.settings.Output.output_table1.val
    print("Done")
Beispiel #9
0
def main():
    hr = HiveRuntime()
    hr.execute("main.hql")
    hr.settings.Output.output_table2.val = hr.settings.Output.output_table1.val
    print("Done")