sqoop export推送案例

#!/bin/bash

#ora数据库参数

 url=jdbc:oracle:thin:@17.16.1.1:1521:orcl

 uid=ods

 pwd=xxxxxx

 table_name=S02_ASSET_PACKAGE_T1

 

#Hive_hdfs 

 hdfs_url=/apps/hive/warehouse/ods.db/s02_asset_package_t1_f

 columns="ID,CODE,TARGET,TYPE,PLAN_AMOUNT,AMOUNT,INVEST_PLAN_ID,RELATIVE_ID,RELATIVE_TYPE,RELATIVE_CODE,RELATIVE_COUNT,MATCH_COUNT,WAIT_RELATIVE_COUNT,INVESTED_RELATIVE_COUNT,INVESTED_AMOUNT,MATCH_AMOUNT,REMAIN_AMOUNT,STATUS,IS_DELETED,CREATED_AT,UPDATED_AT,ETL_DATE"

 

  current_time=`date "+%Y-%m-%d %H:%M:%S"`

 

 hive -e "use ods;

          insert overwrite directory '${hdfs_url}'                

        select ID,CODE,TARGET,TYPE,PLAN_AMOUNT,AMOUNT,INVEST_PLAN_ID,RELATIVE_ID,RELATIVE_TYPE,RELATIVE_CODE,RELATIVE_COUNT,MATCH_COUNT,WAIT_RELATIVE_COUNT,INVESTED_RELATIVE_COUNT,INVESTED_AMOUNT,MATCH_AMOUNT,REMAIN_AMOUNT,STATUS,case when IS_DELETED='false' then 0 when IS_DELETED=

你可能感兴趣的:(sqoop知识点)