<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: change sqoop metastore timezone to GMT in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/change-sqoop-metastore-timezone-to-GMT/m-p/43145#M50641</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/6888"&gt;@yshi﻿&lt;/a&gt;&amp;nbsp;: Hi, Thanks for your response but somehow using &amp;amp; multiple times in the connection string always give me trouble in sqoop commands.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It isn't able to parse the connection string that way and ends up giving socket connection error while creating the job only.&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jul 2016 04:44:11 GMT</pubDate>
    <dc:creator>sim6</dc:creator>
    <dc:date>2016-07-25T04:44:11Z</dc:date>
    <item>
      <title>change sqoop metastore timezone to GMT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/change-sqoop-metastore-timezone-to-GMT/m-p/42596#M50639</link>
      <description>&lt;P&gt;The database has all its dates in GMT while sqoop automatically takes local (Asia/kolkata) for incremental updates.&lt;/P&gt;&lt;P&gt;It probably picks that up from JVM but I need it to use GMT for certain jobs and local for others. How do I get about this?&lt;/P&gt;&lt;P&gt;The link &lt;A href="https://community.cloudera.com/t5/Data-Ingestion-Integration/Sqoop-s-metastore-timezone/td-p/16306" target="_blank"&gt;https://community.cloudera.com/t5/Data-Ingestion-Integration/Sqoop-s-metastore-timezone/td-p/16306&lt;/A&gt;&lt;/P&gt;&lt;P&gt;discusses the same issue. Is there an actual workaround for this? The solution given in the thread did not really work for me .&lt;/P&gt;&lt;P&gt;Here's what I have for a sqoop job:&lt;/P&gt;&lt;PRE&gt;sqoop job -D oracle.sessionTimeZone=GMT -D mapred.child.java.opts=" -Duser.timezone=GMT" --meta-connect jdbc:hsqldb:hsql://FQDN:16000/sqoop --create JOB_NAME -- import --driver com.mysql.jdbc.Driver --connect jdbc:mysql://IP/DB?zeroDateTimeBehavior=convertToNull --username root --password 'PASSWORD' --table TABLE_NAME--incremental lastmodified --check-column updated_at --last-value 0 --merge-key entity_id --split-by entity_id --target-dir LOCATION_SPECIFIED --hive-database Magento --hive-drop-import-delims --null-string '\\N' --null-non-string '\\N' --fields-terminated-by '\001' --input-null-string '\\N' --input-null-non-string '\\N' --input-null-non-string '\\N' --input-fields-terminated-by '\001'&lt;/PRE&gt;&lt;P&gt;logs:&lt;/P&gt;&lt;PRE&gt;5459 [uber-SubtaskRunner] WARN  org.apache.sqoop.tool.SqoopTool  - $SQOOP_CONF_DIR has not been set in the environment. Cannot check for additional configuration.
5497 [uber-SubtaskRunner] INFO  org.apache.sqoop.Sqoop  - Running Sqoop version: 1.4.6-cdh5.7.0
5817 [uber-SubtaskRunner] WARN  org.apache.sqoop.tool.BaseSqoopTool  - Setting your password on the command-line is insecure. Consider using -P instead.
5832 [uber-SubtaskRunner] WARN  org.apache.sqoop.ConnFactory  - $SQOOP_CONF_DIR has not been set in the environment. Cannot check for additional configuration.
5859 [uber-SubtaskRunner] WARN  org.apache.sqoop.ConnFactory  - Parameter --driver is set to an explicit driver however appropriate connection manager is not being set (via --connection-manager). Sqoop is going to fall back to org.apache.sqoop.manager.GenericJdbcManager. Please specify explicitly which connection manager should be used next time.
5874 [uber-SubtaskRunner] INFO  org.apache.sqoop.manager.SqlManager  - Using default fetchSize of 1000
5874 [uber-SubtaskRunner] INFO  org.apache.sqoop.tool.CodeGenTool  - Beginning code generation
6306 [uber-SubtaskRunner] INFO  org.apache.sqoop.manager.SqlManager  - Executing SQL statement: SELECT t.* FROM sales_flat_order AS t WHERE 1=0
6330 [uber-SubtaskRunner] INFO  org.apache.sqoop.manager.SqlManager  - Executing SQL statement: SELECT t.* FROM sales_flat_order AS t WHERE 1=0
6434 [uber-SubtaskRunner] INFO  org.apache.sqoop.orm.CompilationManager  - HADOOP_MAPRED_HOME is /opt/cloudera/parcels/CDH-5.7.0-1.cdh5.7.0.p0.45/lib/hadoop-mapreduce
9911 [uber-SubtaskRunner] INFO  org.apache.sqoop.orm.CompilationManager  - Writing jar file: /tmp/sqoop-yarn/compile/51c9a7f9e76b0547825eb7a852721bf9/sales_flat_order.jar
9928 [uber-SubtaskRunner] INFO  org.apache.sqoop.manager.SqlManager  - Executing SQL statement: SELECT t.* FROM sales_flat_order AS t WHERE 1=0
9941 [uber-SubtaskRunner] INFO  org.apache.sqoop.tool.ImportTool  - Incremental import based on column updated_at
9941 [uber-SubtaskRunner] INFO  org.apache.sqoop.tool.ImportTool  - Lower bound value: '0'
9941 [uber-SubtaskRunner] INFO  org.apache.sqoop.tool.ImportTool  - Upper bound value: '2016-06-30 11:40:36.0'
9943 [uber-SubtaskRunner] INFO  org.apache.sqoop.mapreduce.ImportJobBase  - Beginning import of sales_flat_order
9962 [uber-SubtaskRunner] INFO  org.apache.sqoop.manager.SqlManager  - Executing SQL statement: SELECT t.* FROM sales_flat_order AS t WHERE 1=0
10007 [uber-SubtaskRunner] WARN  org.apache.sqoop.mapreduce.JobBase  - SQOOP_HOME is unset. May not be able to find all job dependencies.
10672 [uber-SubtaskRunner] INFO  org.apache.sqoop.mapreduce.db.DBInputFormat  - Using read commited transaction isolation
10674 [uber-SubtaskRunner] INFO  org.apache.sqoop.mapreduce.db.DataDrivenDBInputFormat  - BoundingValsQuery: SELECT MIN(entity_id), MAX(entity_id) FROM sales_flat_order WHERE ( updated_at &amp;gt;= '0' AND updated_at &amp;lt; '2016-06-30 11:40:36.0' )
11667 [uber-SubtaskRunner] INFO  org.apache.sqoop.mapreduce.db.IntegerSplitter  - Split size: 86592; Num splits: 4 from: 1 to: 346372
Heart beat
42986 [uber-SubtaskRunner] INFO  org.apache.sqoop.mapreduce.ImportJobBase  - Transferred 300.3027 MB in 32.9683 seconds (9.1088 MB/sec)
42995 [uber-SubtaskRunner] INFO  org.apache.sqoop.mapreduce.ImportJobBase  - Retrieved 339510 records.
43008 [uber-SubtaskRunner] INFO  org.apache.sqoop.tool.ImportTool  - Saving incremental import state to the metastore
43224 [uber-SubtaskRunner] INFO  org.apache.sqoop.tool.ImportTool  - Updated data for job: sales_flat_order&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Sep 2022 10:28:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/change-sqoop-metastore-timezone-to-GMT/m-p/42596#M50639</guid>
      <dc:creator>sim6</dc:creator>
      <dc:date>2022-09-16T10:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: change sqoop metastore timezone to GMT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/change-sqoop-metastore-timezone-to-GMT/m-p/43024#M50640</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/16612"&gt;@sim6﻿&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Sorry for the delay in response!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on below 2 parameters:&lt;/P&gt;&lt;PRE&gt;--driver com.mysql.jdbc.Driver --connect jdbc:mysql://IP/DB?zeroDateTimeBehavior=convertToN&lt;/PRE&gt;&lt;P&gt;It looks like that you are importing data from MySQL instead of Oracle. As a result, the workaround mentioned in another thread (&lt;EM&gt;&lt;FONT face="courier new,courier"&gt;-D oracle.sessionTimeZone=GMT&lt;/FONT&gt;&lt;/EM&gt;) won't work, because it is actaully an Oracle database parameter. Sqoop just passes it to Oracle JDBC driver.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not very familiar with MySQL JDBC driver, but according to its document[1], maybe we can&amp;nbsp;achieve your goal with JDBC parameter "useTimezone".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To use GMT time, please try below command:&lt;/P&gt;&lt;PRE&gt;sqoop job --meta-connect jdbc:hsqldb:hsql://FQDN:16000/sqoop \&lt;BR /&gt;--create JOB_NAME -- import --driver com.mysql.jdbc.Driver \&lt;BR /&gt;--connect jdbc:mysql://IP/DB?zeroDateTimeBehavior=convertToull&amp;amp;useTimezone=false \&lt;BR /&gt;--username root --password 'PASSWORD' --table TABLE_NAME \&lt;BR /&gt;--incremental lastmodified --check-column updated_at --last-value 0 \&lt;BR /&gt;--merge-key entity_id --split-by entity_id \&lt;BR /&gt;--target-dir LOCATION_SPECIFIED --hive-database Magento \&lt;BR /&gt;--hive-drop-import-delims --null-string '\\N' \&lt;BR /&gt;--null-non-string '\\N' --fields-terminated-by '\001' \&lt;BR /&gt;--input-null-string '\\N' --input-null-non-string '\\N' \&lt;BR /&gt;--input-null-non-string '\\N' --input-fields-terminated-by '\001'&lt;/PRE&gt;&lt;P&gt;To use your local&amp;nbsp;time, please try below command:&lt;/P&gt;&lt;PRE&gt;sqoop job --meta-connect jdbc:hsqldb:hsql://FQDN:16000/sqoop \&lt;BR /&gt;--create JOB_NAME -- import --driver com.mysql.jdbc.Driver \&lt;BR /&gt;--connect jdbc:mysql://IP/DB?zeroDateTimeBehavior=convertToull&amp;amp;useTimezone=true&amp;amp;serverTimezone=&lt;SPAN&gt;GMT&lt;/SPAN&gt; \&lt;BR /&gt;--username root --password 'PASSWORD' --table TABLE_NAME \&lt;BR /&gt;--incremental lastmodified --check-column updated_at --last-value 0 \&lt;BR /&gt;--merge-key entity_id --split-by entity_id \&lt;BR /&gt;--target-dir LOCATION_SPECIFIED --hive-database Magento \&lt;BR /&gt;--hive-drop-import-delims --null-string '\\N' \&lt;BR /&gt;--null-non-string '\\N' --fields-terminated-by '\001' \&lt;BR /&gt;--input-null-string '\\N' --input-null-non-string '\\N' \&lt;BR /&gt;--input-null-non-string '\\N' --input-fields-terminated-by '\001'&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Notice:&lt;/P&gt;&lt;P&gt;1) Please use the latest MySQL jdbc driver: 5.1.34&lt;/P&gt;&lt;P&gt;2) Please make sure that the timezone used in database is GMT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And please contact your MySQL team to seek some suggestions from them. This is more a MySQL problem than a Sqoop problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2016 01:34:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/change-sqoop-metastore-timezone-to-GMT/m-p/43024#M50640</guid>
      <dc:creator>yshi</dc:creator>
      <dc:date>2016-07-20T01:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: change sqoop metastore timezone to GMT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/change-sqoop-metastore-timezone-to-GMT/m-p/43145#M50641</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/6888"&gt;@yshi﻿&lt;/a&gt;&amp;nbsp;: Hi, Thanks for your response but somehow using &amp;amp; multiple times in the connection string always give me trouble in sqoop commands.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It isn't able to parse the connection string that way and ends up giving socket connection error while creating the job only.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2016 04:44:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/change-sqoop-metastore-timezone-to-GMT/m-p/43145#M50641</guid>
      <dc:creator>sim6</dc:creator>
      <dc:date>2016-07-25T04:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: change sqoop metastore timezone to GMT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/change-sqoop-metastore-timezone-to-GMT/m-p/43146#M50642</link>
      <description>Using a single quote around the value will help it get evaluated properly&lt;BR /&gt;in shell. The &amp;amp; is otherwise taken as a token to fork the process. An ex.&lt;BR /&gt;of quoting in shell:&lt;BR /&gt;&lt;BR /&gt;…&lt;BR /&gt;--connect 'jdbc:mysql://IP/DB?zeroDateTimeBehavior=&lt;BR /&gt;convertToull&amp;amp;useTimezone=true&amp;amp;serverTimezone=GMT' \&lt;BR /&gt;…&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 25 Jul 2016 04:57:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/change-sqoop-metastore-timezone-to-GMT/m-p/43146#M50642</guid>
      <dc:creator>Harsh J</dc:creator>
      <dc:date>2016-07-25T04:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: change sqoop metastore timezone to GMT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/change-sqoop-metastore-timezone-to-GMT/m-p/43147#M50643</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/213"&gt;@Harsh J﻿&lt;/a&gt;: I thought so too but that still gives the error exception creating sql connection&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2016 05:16:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/change-sqoop-metastore-timezone-to-GMT/m-p/43147#M50643</guid>
      <dc:creator>sim6</dc:creator>
      <dc:date>2016-07-25T05:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: change sqoop metastore timezone to GMT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/change-sqoop-metastore-timezone-to-GMT/m-p/43149#M50644</link>
      <description>&lt;P&gt;Awesome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thank worked.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just let me know if I can help you with a review may be? I would love to do that. Thanks much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/6888"&gt;@yshi﻿&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2016 05:31:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/change-sqoop-metastore-timezone-to-GMT/m-p/43149#M50644</guid>
      <dc:creator>sim6</dc:creator>
      <dc:date>2016-07-25T05:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: change sqoop metastore timezone to GMT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/change-sqoop-metastore-timezone-to-GMT/m-p/43162#M50645</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/213"&gt;@Harsh J﻿&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Thanks! I made a mistake with the command -- forgot the single quote &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/16612"&gt;@sim6﻿&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Thanks for your offer! I would like to hear a review from you! Would you please let me know your availability?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2016 12:09:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/change-sqoop-metastore-timezone-to-GMT/m-p/43162#M50645</guid>
      <dc:creator>yshi</dc:creator>
      <dc:date>2016-07-25T12:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: change sqoop metastore timezone to GMT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/change-sqoop-metastore-timezone-to-GMT/m-p/43251#M50646</link>
      <description>&lt;P&gt;Oh, That sounds cool. I am available post 7:00 p.m IST. Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jul 2016 10:13:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/change-sqoop-metastore-timezone-to-GMT/m-p/43251#M50646</guid>
      <dc:creator>sim6</dc:creator>
      <dc:date>2016-07-27T10:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: change sqoop metastore timezone to GMT</title>
      <link>https://community.cloudera.com/t5/Support-Questions/change-sqoop-metastore-timezone-to-GMT/m-p/43303#M50647</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/16612"&gt;@sim6﻿&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Sorry, I cannot make that time. Could you please paste the information here?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2016 04:05:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/change-sqoop-metastore-timezone-to-GMT/m-p/43303#M50647</guid>
      <dc:creator>yshi</dc:creator>
      <dc:date>2016-07-28T04:05:47Z</dc:date>
    </item>
  </channel>
</rss>

