[ERROR] Terminal initialization failed; falling back to unsupported java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected at jline.TerminalFactory.create(TerminalFactory.java:101) at jline.TerminalFactory.get(TerminalFactory.java:158) at jline.console.ConsoleReader.<init>(ConsoleReader.java:229) at jline.console.ConsoleReader.<init>(ConsoleReader.java:221) at jline.console.ConsoleReader.<init>(ConsoleReader.java:209) at org.apache.hadoop.hive.cli.CliDriver.getConsoleReader(CliDriver.java:773) at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:715) at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:675) at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:615) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.hadoop.util.RunJar.run(RunJar.java:221) at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
<property> <!--- 如果启用了 LIMIT 优化,这个用来控制 LIMIT 的最小行取样量 --> <name>hive.limit.row.max.size</name> <value>100000</value> <description>When trying a smaller subset of data for simple LIMIT, how much size we need to guarantee each row to have at least.</description> </property> <property> <!--- 如果启用了 LIMIT 优化,这个用来控制 LIMIT 的最大文件数 --> <name>hive.limit.optimize.limit.file</name> <value>10</value> <description>When trying a smaller subset of data for simple LIMIT, maximum number of files we can sample.</description> </property> <property> <!--- 是否启用 LIMIT 优化,这是对元数据进行抽样统计,有可能输入有用的数据永远不会被处理到。毕竟是抽样 --> <name>hive.limit.optimize.enable</name> <value>true</value> <description>Whether to enable to optimization to trying a smaller subset of data for simple LIMIT first.</description> </property>
<property> <!--- 并行执行,一个查询可能会有多个阶段而且这些阶段可能并非完全相互依赖,所以阶段越多job可能就更快完成。同时它会增加对集群的利用率 --> <name>hive.exec.parallel</name> <value>true</value> <description>Whether to execute jobs in parallel</description> </property> <property> <!--- 并行执行最大线程数 --> <name>hive.exec.parallel.thread.number</name> <value>8</value> <description>How many jobs at most can be executed in parallel</description> </property>
<property> <!--- 严格模式,如果修改为 strict 那么会禁止3种类型的查询:1.不限制分区查询(不允许用户扫描所有分区,where必须有两个或以上) 2.order by必须要LIMIT 3.限制笛卡积尔查询,多表连接查询应该使用join 和on --> <name>hive.mapred.mode</name> <value>nonstrict</value> <description> The mode in which the Hive operations are being performed. In strict mode, some risky queries are not allowed to run. They include: Cartesian Product. No partition being picked up for a query. Comparing bigints and strings. Comparing bigints and doubles. Orderby without limit. </description> </property>
<property> <!-- 因为Hive使用输入数据量的大小来确定reducer个数,修改这个数量就可以更改使用reducer的个数 --> <name>hive.exec.reducers.bytes.per.reducer</name> <value>256000000</value> <description>size per reducer.The default is 256Mb, i.e if the input size is 1G, it will use 4 reducers.</description> </property> <property> <!-- 设置一个查询最多可消耗的reducers的量--> <name>hive.exec.reducers.max</name> <value>1009</value> <description> max number of reducers will be used. If the one specified in the configuration parameter mapred.reduce.tasks is negative, Hive will use this one as the max number of reducers when automatically determine number of reducers. </description> </property>
Warning: /root/sqoop-1.4.7.bin__hadoop-2.6.0/../hbase does not exist! HBase imports will fail. Please set $HBASE_HOME to the root of your HBase installation. Warning: /root/sqoop-1.4.7.bin__hadoop-2.6.0/../hcatalog does not exist! HCatalog jobs will fail. Please set $HCAT_HOME to the root of your HCatalog installation. Warning: /root/sqoop-1.4.7.bin__hadoop-2.6.0/../accumulo does not exist! Accumulo imports will fail. Please set $ACCUMULO_HOME to the root of your Accumulo installation. Warning: /root/sqoop-1.4.7.bin__hadoop-2.6.0/../zookeeper does not exist! Accumulo imports will fail. Please set $ZOOKEEPER_HOME to the root of your Zookeeper installation. 19/04/20 18:55:32 INFO sqoop.Sqoop: Running Sqoop version: 1.4.7 usage: sqoop COMMAND [ARGS]
Available commands: codegen Generate code to interact with database records create-hive-table Import a table definition into Hive eval Evaluate a SQL statement and display the results export Export an HDFS directory to a database table help List available commands import Import a table from a database to HDFS import-all-tables Import tables from a database to HDFS import-mainframe Import datasets from a mainframe server to HDFS job Work with saved jobs list-databases List available databases on a server list-tables List available tables in a database merge Merge results of incremental imports metastore Run a standalone Sqoop metastore version Display version information
See 'sqoop help COMMAND' for information on a specific command.
## Moved to be a runtime check in sqoop. #if [ ! -d "${HBASE_HOME}" ]; then # echo"Warning: $HBASE_HOME does not exist! HBase imports will fail." # echo'Please set $HBASE_HOME to the root of your HBase installation.' #fi ## Moved to be a runtime check in sqoop. #if [ ! -d "${HCAT_HOME}" ]; then # echo"Warning: $HCAT_HOME does not exist! HCatalog jobs will fail." # echo'Please set $HCAT_HOME to the root of your HCatalog installation.' #fi #if [ ! -d "${ACCUMULO_HOME}" ]; then # echo"Warning: $ACCUMULO_HOME does not exist! Accumulo imports will fail." # echo'Please set $ACCUMULO_HOME to the root of your Accumulo installation.' #fi #if [ ! -d "${ZOOKEEPER_HOME}" ]; then # echo"Warning: $ZOOKEEPER_HOME does not exist! Accumulo imports will fail." # echo'Please set $ZOOKEEPER_HOME to the root of your Zookeeper installation.' #fi
2019-04-21T01:53:51.675008Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2019-04-21T01:53:52.388438Z 0 [Warning] InnoDB: New log files created, LSN=45790 2019-04-21T01:53:52.484682Z 0 [Warning] InnoDB: Creating foreign key constraint system tables. 2019-04-21T01:53:52.549955Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 5075e10a-63d8-11e9-9cd1-000c2937e0f0. 2019-04-21T01:53:52.552680Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened. 2019-04-21T01:53:52.583134Z 1 [Note] A temporary password is generated for root@localhost: zeAxOg16AZ!7
Automatically selecting localonly mode for query Query ID = root_20190421152828_c7eaeae7-4e76-48fb-9780-135262ef66e0 Total jobs =2 Launching Job 1outof2 Number of reduce tasks not specified. Estimated from input data size: 1 Inorderto change the average load for a reducer (in bytes): set hive.exec.reducers.bytes.per.reducer=<number> Inorderto limit the maximum number of reducers: set hive.exec.reducers.max=<number> Inordertoset a constant number of reducers: set mapreduce.job.reduces=<number> Job runningin-process (local Hadoop) 2019-04-2115:28:21,976 Stage-1 map =100%, reduce =100% Ended Job = job_local1573803716_0003 Launching Job 2outof2 Number of reduce tasks determined at compile time: 1 Inorderto change the average load for a reducer (in bytes): set hive.exec.reducers.bytes.per.reducer=<number> Inorderto limit the maximum number of reducers: set hive.exec.reducers.max=<number> Inordertoset a constant number of reducers: set mapreduce.job.reduces=<number> Job runningin-process (local Hadoop) 2019-04-2115:28:23,199 Stage-2 map =100%, reduce =100% Ended Job = job_local1403411610_0004 MapReduce Jobs Launched: Stage-Stage-1: HDFS Read: 20435416 HDFS Write: 1483 SUCCESS Stage-Stage-2: HDFS Read: 20436422 HDFS Write: 2021 SUCCESS Total MapReduce CPU Time Spent: 0 msec OK 深圳 2128 北京 610 上海 209 广州 123 成都 40 武汉 20 杭州 20 马来西亚 10 香港 10 韩国 10 美国 10 日本 10 Time taken: 2.78 seconds, Fetched: 12row(s)
ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.RuntimeException: Could not load db driver class: com.mysql.jdbc.Driver java.lang.RuntimeException: Could not load db driver class: com.mysql.jdbc.Driver
use target; select*from data limit 1; select name,location,tag from data limit 10; select location,count(*) as sum from data groupby location orderby sum desc;
<property> <name>javax.jdo.option.ConnectionPassword</name> <value>your_password</value> <description>password to use against metastore database</description> </property>
<property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://localhost:3306/hive?useSSL=true</value> <description>JDBC connect string for a JDBC metastore</description> </property>
<property> <name>javax.jdo.option.ConnectionDriverName</name> <value>com.mysql.jdbc.Driver</value> <description>Driver class name for a JDBC metastore</description> </property>
<property> <name>javax.jdo.option.ConnectionUserName</name> <value>root</value> <description>Username to use against metastore database</description> </property>