sarutak commented on a change in pull request #31721: URL: https://github.com/apache/spark/pull/31721#discussion_r589709579
########## File path: docs/sql-ref-syntax-aux-resource-mgmt-add-archive.md ########## @@ -0,0 +1,53 @@ +--- +layout: global +title: ADD ARCHIVE +displayTitle: ADD ARCHIVE +license: | + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--- + +### Description + +`ADD ARCHIVE` can be used to add an archive file to the list of resources. The given archive file should be one of .zip, .tar, .tar.gz, .tgz and .jar. The added archive file can be listed using [LIST ARCHIVE](sql-ref-syntax-aux-resource-mgmt-list-archive.html). Review comment: Thanks. I've updated. ########## File path: sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala ########## @@ -857,6 +857,31 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd assert(sql(s"list file $testFile").count() == 1) } + test("ADD ARCHIVE command") { + withTempDir { dir => + val file = File.createTempFile("someprefix1", "somesuffix1", dir) + val zipFile = new File(dir, "test.zip") + TestUtils.createJar(Seq(file), zipFile) + sql(s"ADD ARCHIVE ${zipFile.getAbsolutePath}#foo") Review comment: > Could you add a test for ADD ARCHIVES, too? It's not supported. > What if the given file does not exist? Also, what if the given file has a unsupported format? Covered such cases. ########## File path: docs/sql-ref-syntax-aux-resource-mgmt-list-archive.md ########## @@ -0,0 +1,53 @@ +--- +layout: global +title: LIST ARCHIVE +displayTitle: LIST ARCHIVE +license: | + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--- + +### Description + +`LIST ARCHIVE` lists the archives added by [ADD ARCHIVE](sql-ref-syntax-aux-resource-mgmt-add-archive.html). Review comment: Done. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
