Query is not working


#1

sqoop import
–connect jdbc:mysql://ms.itversity.com:3306/retail_db
–username retail_user
–P itversity
–target-dir /user/dbaanujkumar/sqoop_import/retail_db/orders_with_revenue
–num-mappers 2
–query “select o.*,sum(oi.order_item_subtotal) order_revenue from orders o
join order_items oi on o.order_id = oi.order_item_order_id and $CONDITION group by o.order_id,o.order_date,o.order_customer_id,o.order_status” \
–split-by order_id

and

sqoop import
–connect jdbc:mysql://ms.itversity.com:3306/retail_db
–username retail_user
–password itversity
–target-dir /user/dbaanujkumar/sqoop_import/retail_db/orders_with_revenue
–num-mappers 2
–query “select o.*,sum(oi.order_item_subtotal) order_revenue from orders o
join order_items oi on o.order_id = oi.order_item_order_id and $CONDITION group by o.order_id,o.order_date,o.order_customer_id,o.order_status” \
–split-by order_id

it is not taking --split-by order_id


#2

You have to use ‘$CONDITIONS’ instead of just $CONDITION.