You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (JIRA)" <ji...@apache.org> on 2017/01/20 12:45:26 UTC

[jira] [Commented] (SPARK-19134) Fix several sql, mllib and status api examples not working

    [ https://issues.apache.org/jira/browse/SPARK-19134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15831680#comment-15831680 ] 

Hyukjin Kwon commented on SPARK-19134:
--------------------------------------

Oh [~yanboliang], it seems mistakenly not resolved.. :)

> Fix several sql, mllib and status api examples not working
> ----------------------------------------------------------
>
>                 Key: SPARK-19134
>                 URL: https://issues.apache.org/jira/browse/SPARK-19134
>             Project: Spark
>          Issue Type: Bug
>          Components: MLlib, PySpark, SQL
>            Reporter: Hyukjin Kwon
>            Priority: Minor
>
> *binary_classification_metrics_example.py*
> {code}
> ./bin/spark-submit examples/src/main/python/mllib/binary_classification_metrics_example.py
> {code}
> {code}
>   File ".../spark/examples/src/main/python/mllib/binary_classification_metrics_example.py", line 39, in <lambda>
>     .rdd.map(lambda row: LabeledPoint(row[0], row[1]))
>   File ".../spark/python/pyspark/mllib/regression.py", line 54, in __init__
>     self.features = _convert_to_vector(features)
>   File ".../spark/python/pyspark/mllib/linalg/__init__.py", line 80, in _convert_to_vector
>     raise TypeError("Cannot convert type %s into Vector" % type(l))
> TypeError: Cannot convert type <class 'pyspark.ml.linalg.SparseVector'> into Vector
> {code}
> *status_api_demo.py*
> {code}
> PYSPARK_PYTHON=python3 ./bin/spark-submit examples/src/main/python/status_api_demo.py
> {code}
> {code}
> Traceback (most recent call last):
>   File ".../spark/examples/src/main/python/status_api_demo.py", line 22, in <module>
>     import Queue
> ImportError: No module named 'Queue'
> {code}
> *bisecting_k_means_example.py*
> {code}
> ./bin/spark-submit examples/src/main/python/mllib/bisecting_k_means_example.py
> {code}
> {code}
> Traceback (most recent call last):
>   File "/Users/hyukjinkwon/Desktop/workspace/repos/forked/spark/examples/src/main/python/mllib/bisecting_k_means_example.py", line 46, in <module>
>     model.save(sc, path)
> AttributeError: 'BisectingKMeansModel' object has no attribute 'save'
> {code}
> *elementwise_product_example.py*
> {code}
> ./bin/spark-submit examples/src/main/python/mllib/elementwise_product_example.py
> {code}
> {code}
> Traceback (most recent call last):
>   File "/Users/hyukjinkwon/Desktop/workspace/repos/forked/spark/examples/src/main/python/mllib/elementwise_product_example.py", line 48, in <module>
>     for each in transformedData2.collect():
>   File "/Users/hyukjinkwon/Desktop/workspace/repos/forked/spark/python/pyspark/mllib/linalg/__init__.py", line 478, in __getattr__
>     return getattr(self.array, item)
> AttributeError: 'numpy.ndarray' object has no attribute 'collect'
> {code}
> *hive.py*
> {code}
> ./bin/spark-submit examples/src/main/python/sql/hive.py
> {code}
> {code}
> Traceback (most recent call last):
>   File "/Users/hyukjinkwon/Desktop/workspace/repos/forked/spark/examples/src/main/python/sql/hive.py", line 47, in <module>
>     spark.sql("CREATE TABLE IF NOT EXISTS src (key INT, value STRING) USING hive")
>   File "/Users/hyukjinkwon/Desktop/workspace/repos/forked/spark/python/lib/pyspark.zip/pyspark/sql/session.py", line 541, in sql
>   File "/Users/hyukjinkwon/Desktop/workspace/repos/forked/spark/python/lib/py4j-0.10.4-src.zip/py4j/java_gateway.py", line 1133, in __call__
>   File "/Users/hyukjinkwon/Desktop/workspace/repos/forked/spark/python/lib/pyspark.zip/pyspark/sql/utils.py", line 69, in deco
> pyspark.sql.utils.AnalysisException: 'org.apache.hadoop.hive.ql.metadata.HiveException: MetaException(message:java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: file:./spark-warehouse);'
> {code}
> *SparkHiveExample*
> {code}
> ./bin/run-example sql.hive.SparkHiveExample
> {code}
> {code}
> Exception in thread "main" org.apache.hadoop.hive.ql.metadata.HiveException: Unable to alter table. java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: file:./spark-warehouse
> 	at org.apache.hadoop.hive.ql.metadata.Hive.alterTable(Hive.java:498)
> 	at org.apache.hadoop.hive.ql.metadata.Hive.alterTable(Hive.java:484)
> 	at org.apache.hadoop.hive.ql.metadata.Hive.loadTable(Hive.java:1668)
> 	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:497)
> 	at org.apache.spark.sql.hive.client.Shim_v0_14.loadTable(HiveShim.scala:722)
> 	at org.apache.spark.sql.hive.client.HiveClientImpl$$anonfun$loadTable$1.apply$mcV$sp(HiveClientImpl.scala:686)
> 	at org.apache.spark.sql.hive.client.HiveClientImpl$$anonfun$loadTable$1.apply(HiveClientImpl.scala:686)
> 	at org.apache.spark.sql.hive.client.HiveClientImpl$$anonfun$loadTable$1.apply(HiveClientImpl.scala:686)
> 	at org.apache.spark.sql.hive.client.HiveClientImpl$$anonfun$withHiveState$1.apply(HiveClientImpl.scala:283)
> 	at org.apache.spark.sql.hive.client.HiveClientImpl.liftedTree1$1(HiveClientImpl.scala:230)
> 	at org.apache.spark.sql.hive.client.HiveClientImpl.retryLocked(HiveClientImpl.scala:229)
> 	at org.apache.spark.sql.hive.client.HiveClientImpl.withHiveState(HiveClientImpl.scala:272)
> 	at org.apache.spark.sql.hive.client.HiveClientImpl.loadTable(HiveClientImpl.scala:685)
> {code}
> *JavaSparkHiveExample*
> {code}
> ./bin/run-example sql.hive.JavaSparkHiveExample
> {code}
> {code}
> Exception in thread "main" org.apache.hadoop.hive.ql.metadata.HiveException: Unable to alter table. java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: file:./spark-warehouse
> 	at org.apache.hadoop.hive.ql.metadata.Hive.alterTable(Hive.java:498)
> 	at org.apache.hadoop.hive.ql.metadata.Hive.alterTable(Hive.java:484)
> 	at org.apache.hadoop.hive.ql.metadata.Hive.loadTable(Hive.java:1668)
> 	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:497)
> 	at org.apache.spark.sql.hive.client.Shim_v0_14.loadTable(HiveShim.scala:722)
> 	at org.apache.spark.sql.hive.client.HiveClientImpl$$anonfun$loadTable$1.apply$mcV$sp(HiveClientImpl.scala:686)
> 	at org.apache.spark.sql.hive.client.HiveClientImpl$$anonfun$loadTable$1.apply(HiveClientImpl.scala:686)
> 	at org.apache.spark.sql.hive.client.HiveClientImpl$$anonfun$loadTable$1.apply(HiveClientImpl.scala:686)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org