Problem with a sqoop eval query


#1

sqoop eval --connect “jdbc:mysql://nn01.itversity.com:3306/retail_export” --username retail_dba --password itversity --query “select o.order_status, quarter(o.order_date), sum(oi.order_item_subtotal) from orders o join order_items oi on o.order_id = oi.order_item_order_id group by o.order_status, quarter(o.order_date)”

this is what I have been trying to run.

this is what I am getting

Warning: /usr/hdp/2.5.0.0-1245/accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
18/06/01 01:40:37 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6.2.5.0.0-1245
18/06/01 01:40:37 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P inst
ead.
18/06/01 01:40:37 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.

Is something wrong with my query?
Thanks in advance


#2

Hi,
Nothing wrong in query. Problem with db. Order table not exist in retail_export. Kindly try in retail_db.
You will get the result.

Here the result.

[anuvenkatesheee@gw03 ~]$ sqoop eval --connect “jdbc:mysql://nn01.itversity.com:3306/retail_db” --username retail_dba --password itversity --query “select o.order_status, quarter(o.order_date), sum(oi.order_item_subtotal) from orders o join order_items oi on o.order_id = oi.order_item_order_id group by o.order_status, quarter(o.order_date)”
Warning: /usr/hdp/2.5.0.0-1245/accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
18/06/01 02:12:52 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6.2.5.0.0-1245
18/06/01 02:12:52 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
18/06/01 02:12:52 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.

| order_status | quarter(o.order_date) | sum(oi.order_item_subtotal) |

| CANCELED | 1 | 176923.80335998535 |
| CANCELED | 2 | 152706.4730644226 |
| CANCELED | 3 | 189596.63367652893 |
| CANCELED | 4 | 176804.09331703186 |
| CLOSED | 1 | 902545.9277019501 |
| CLOSED | 2 | 862114.0266036987 |
| CLOSED | 3 | 989349.9392662048 |
| CLOSED | 4 | 982038.9690513611 |
| COMPLETE | 1 | 2816796.94499588 |
| COMPLETE | 2 | 2789042.9534893036 |
| COMPLETE | 3 | 2823791.0547504425 |
| COMPLETE | 4 | 2847302.956068039 |
| ON_HOLD | 1 | 492549.66999435425 |


#3

got it.
Thanks venkatesh