[jira] [Updated] (HIVE-16943) MoveTask should separate src FileSystem from dest FileSystem

2017-06-26 Thread Ashutosh Chauhan (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-16943?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ashutosh Chauhan updated HIVE-16943:

   Resolution: Fixed
Fix Version/s: 3.0.0
   Status: Resolved  (was: Patch Available)

Pushed to master. Thanks, Fei!

> MoveTask should separate src FileSystem from dest FileSystem 
> -
>
> Key: HIVE-16943
> URL: https://issues.apache.org/jira/browse/HIVE-16943
> Project: Hive
>  Issue Type: Bug
>  Components: Query Processor
>Affects Versions: 3.0.0
>Reporter: Fei Hui
>Assignee: Fei Hui
> Fix For: 3.0.0
>
> Attachments: HIVE-16943.1.patch
>
>
> {code:title=MoveTask.java|borderStyle=solid} 
>  private void moveFileInDfs (Path sourcePath, Path targetPath, FileSystem fs)
>   throws HiveException, IOException {
> // if source exists, rename. Otherwise, create a empty directory
> if (fs.exists(sourcePath)) {
>   Path deletePath = null;
>   // If it multiple level of folder are there fs.rename is failing so 
> first
>   // create the targetpath.getParent() if it not exist
>   if (HiveConf.getBoolVar(conf, 
> HiveConf.ConfVars.HIVE_INSERT_INTO_MULTILEVEL_DIRS)) {
> deletePath = createTargetPath(targetPath, fs);
>   }
>   Hive.clearDestForSubDirSrc(conf, targetPath, sourcePath, false);
>   if (!Hive.moveFile(conf, sourcePath, targetPath, true, false)) {
> try {
>   if (deletePath != null) {
> fs.delete(deletePath, true);
>   }
> } catch (IOException e) {
>   LOG.info("Unable to delete the path created for facilitating rename"
>   + deletePath);
> }
> throw new HiveException("Unable to rename: " + sourcePath
> + " to: " + targetPath);
>   }
> } else if (!fs.mkdirs(targetPath)) {
>   throw new HiveException("Unable to make directory: " + targetPath);
> }
>   }
> {code}
> Maybe sourcePath and targetPath come from defferent filesystem, we should 
> separate them.
> I see that HIVE-11568 had done it in Hive.java



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-16943) MoveTask should separate src FileSystem from dest FileSystem

2017-06-22 Thread Fei Hui (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-16943?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Fei Hui updated HIVE-16943:
---
Status: Patch Available  (was: Open)

> MoveTask should separate src FileSystem from dest FileSystem 
> -
>
> Key: HIVE-16943
> URL: https://issues.apache.org/jira/browse/HIVE-16943
> Project: Hive
>  Issue Type: Bug
>  Components: Query Processor
>Affects Versions: 3.0.0
>Reporter: Fei Hui
>Assignee: Fei Hui
> Attachments: HIVE-16943.1.patch
>
>
> {code:title=MoveTask.java|borderStyle=solid} 
>  private void moveFileInDfs (Path sourcePath, Path targetPath, FileSystem fs)
>   throws HiveException, IOException {
> // if source exists, rename. Otherwise, create a empty directory
> if (fs.exists(sourcePath)) {
>   Path deletePath = null;
>   // If it multiple level of folder are there fs.rename is failing so 
> first
>   // create the targetpath.getParent() if it not exist
>   if (HiveConf.getBoolVar(conf, 
> HiveConf.ConfVars.HIVE_INSERT_INTO_MULTILEVEL_DIRS)) {
> deletePath = createTargetPath(targetPath, fs);
>   }
>   Hive.clearDestForSubDirSrc(conf, targetPath, sourcePath, false);
>   if (!Hive.moveFile(conf, sourcePath, targetPath, true, false)) {
> try {
>   if (deletePath != null) {
> fs.delete(deletePath, true);
>   }
> } catch (IOException e) {
>   LOG.info("Unable to delete the path created for facilitating rename"
>   + deletePath);
> }
> throw new HiveException("Unable to rename: " + sourcePath
> + " to: " + targetPath);
>   }
> } else if (!fs.mkdirs(targetPath)) {
>   throw new HiveException("Unable to make directory: " + targetPath);
> }
>   }
> {code}
> Maybe sourcePath and targetPath come from defferent filesystem, we should 
> separate them.
> I see that HIVE-11568 had done it in Hive.java



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-16943) MoveTask should separate src FileSystem from dest FileSystem

2017-06-22 Thread Fei Hui (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-16943?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Fei Hui updated HIVE-16943:
---
Attachment: HIVE-16943.1.patch

> MoveTask should separate src FileSystem from dest FileSystem 
> -
>
> Key: HIVE-16943
> URL: https://issues.apache.org/jira/browse/HIVE-16943
> Project: Hive
>  Issue Type: Bug
>  Components: Query Processor
>Affects Versions: 3.0.0
>Reporter: Fei Hui
>Assignee: Fei Hui
> Attachments: HIVE-16943.1.patch
>
>
> {code:title=MoveTask.java|borderStyle=solid} 
>  private void moveFileInDfs (Path sourcePath, Path targetPath, FileSystem fs)
>   throws HiveException, IOException {
> // if source exists, rename. Otherwise, create a empty directory
> if (fs.exists(sourcePath)) {
>   Path deletePath = null;
>   // If it multiple level of folder are there fs.rename is failing so 
> first
>   // create the targetpath.getParent() if it not exist
>   if (HiveConf.getBoolVar(conf, 
> HiveConf.ConfVars.HIVE_INSERT_INTO_MULTILEVEL_DIRS)) {
> deletePath = createTargetPath(targetPath, fs);
>   }
>   Hive.clearDestForSubDirSrc(conf, targetPath, sourcePath, false);
>   if (!Hive.moveFile(conf, sourcePath, targetPath, true, false)) {
> try {
>   if (deletePath != null) {
> fs.delete(deletePath, true);
>   }
> } catch (IOException e) {
>   LOG.info("Unable to delete the path created for facilitating rename"
>   + deletePath);
> }
> throw new HiveException("Unable to rename: " + sourcePath
> + " to: " + targetPath);
>   }
> } else if (!fs.mkdirs(targetPath)) {
>   throw new HiveException("Unable to make directory: " + targetPath);
> }
>   }
> {code}
> Maybe sourcePath and targetPath come from defferent filesystem, we should 
> separate them.
> I see that HIVE-11568 had done it in Hive.java



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-16943) MoveTask should separate src FileSystem from dest FileSystem

2017-06-22 Thread Fei Hui (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-16943?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Fei Hui updated HIVE-16943:
---
Attachment: (was: HIVE-16943.patch)

> MoveTask should separate src FileSystem from dest FileSystem 
> -
>
> Key: HIVE-16943
> URL: https://issues.apache.org/jira/browse/HIVE-16943
> Project: Hive
>  Issue Type: Bug
>  Components: Query Processor
>Affects Versions: 3.0.0
>Reporter: Fei Hui
>Assignee: Fei Hui
> Attachments: HIVE-16943.1.patch
>
>
> {code:title=MoveTask.java|borderStyle=solid} 
>  private void moveFileInDfs (Path sourcePath, Path targetPath, FileSystem fs)
>   throws HiveException, IOException {
> // if source exists, rename. Otherwise, create a empty directory
> if (fs.exists(sourcePath)) {
>   Path deletePath = null;
>   // If it multiple level of folder are there fs.rename is failing so 
> first
>   // create the targetpath.getParent() if it not exist
>   if (HiveConf.getBoolVar(conf, 
> HiveConf.ConfVars.HIVE_INSERT_INTO_MULTILEVEL_DIRS)) {
> deletePath = createTargetPath(targetPath, fs);
>   }
>   Hive.clearDestForSubDirSrc(conf, targetPath, sourcePath, false);
>   if (!Hive.moveFile(conf, sourcePath, targetPath, true, false)) {
> try {
>   if (deletePath != null) {
> fs.delete(deletePath, true);
>   }
> } catch (IOException e) {
>   LOG.info("Unable to delete the path created for facilitating rename"
>   + deletePath);
> }
> throw new HiveException("Unable to rename: " + sourcePath
> + " to: " + targetPath);
>   }
> } else if (!fs.mkdirs(targetPath)) {
>   throw new HiveException("Unable to make directory: " + targetPath);
> }
>   }
> {code}
> Maybe sourcePath and targetPath come from defferent filesystem, we should 
> separate them.
> I see that HIVE-11568 had done it in Hive.java



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-16943) MoveTask should separate src FileSystem from dest FileSystem

2017-06-22 Thread Fei Hui (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-16943?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Fei Hui updated HIVE-16943:
---
Attachment: HIVE-16943.patch

patch upload

> MoveTask should separate src FileSystem from dest FileSystem 
> -
>
> Key: HIVE-16943
> URL: https://issues.apache.org/jira/browse/HIVE-16943
> Project: Hive
>  Issue Type: Bug
>  Components: Query Processor
>Affects Versions: 3.0.0
>Reporter: Fei Hui
> Attachments: HIVE-16943.patch
>
>
> {code:title=MoveTask.java|borderStyle=solid} 
>  private void moveFileInDfs (Path sourcePath, Path targetPath, FileSystem fs)
>   throws HiveException, IOException {
> // if source exists, rename. Otherwise, create a empty directory
> if (fs.exists(sourcePath)) {
>   Path deletePath = null;
>   // If it multiple level of folder are there fs.rename is failing so 
> first
>   // create the targetpath.getParent() if it not exist
>   if (HiveConf.getBoolVar(conf, 
> HiveConf.ConfVars.HIVE_INSERT_INTO_MULTILEVEL_DIRS)) {
> deletePath = createTargetPath(targetPath, fs);
>   }
>   Hive.clearDestForSubDirSrc(conf, targetPath, sourcePath, false);
>   if (!Hive.moveFile(conf, sourcePath, targetPath, true, false)) {
> try {
>   if (deletePath != null) {
> fs.delete(deletePath, true);
>   }
> } catch (IOException e) {
>   LOG.info("Unable to delete the path created for facilitating rename"
>   + deletePath);
> }
> throw new HiveException("Unable to rename: " + sourcePath
> + " to: " + targetPath);
>   }
> } else if (!fs.mkdirs(targetPath)) {
>   throw new HiveException("Unable to make directory: " + targetPath);
> }
>   }
> {code}
> Maybe sourcePath and targetPath come from defferent filesystem, we should 
> separate them.
> I see that HIVE-11568 had done it in Hive.java



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)