久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<i id='Mffsj'><tr id='Mffsj'><dt id='Mffsj'><q id='Mffsj'><span id='Mffsj'><b id='Mffsj'><form id='Mffsj'><ins id='Mffsj'></ins><ul id='Mffsj'></ul><sub id='Mffsj'></sub></form><legend id='Mffsj'></legend><bdo id='Mffsj'><pre id='Mffsj'><center id='Mffsj'></center></pre></bdo></b><th id='Mffsj'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Mffsj'><tfoot id='Mffsj'></tfoot><dl id='Mffsj'><fieldset id='Mffsj'></fieldset></dl></div>

    <bdo id='Mffsj'></bdo><ul id='Mffsj'></ul>
  • <small id='Mffsj'></small><noframes id='Mffsj'>

    <tfoot id='Mffsj'></tfoot>
    <legend id='Mffsj'><style id='Mffsj'><dir id='Mffsj'><q id='Mffsj'></q></dir></style></legend>

      1. pyspark mysql jdbc load 調用 o23.load 時發生錯誤 沒有合

        pyspark mysql jdbc load An error occurred while calling o23.load No suitable driver(pyspark mysql jdbc load 調用 o23.load 時發生錯誤 沒有合適的驅動程序)
          • <legend id='yOkB4'><style id='yOkB4'><dir id='yOkB4'><q id='yOkB4'></q></dir></style></legend>
            <i id='yOkB4'><tr id='yOkB4'><dt id='yOkB4'><q id='yOkB4'><span id='yOkB4'><b id='yOkB4'><form id='yOkB4'><ins id='yOkB4'></ins><ul id='yOkB4'></ul><sub id='yOkB4'></sub></form><legend id='yOkB4'></legend><bdo id='yOkB4'><pre id='yOkB4'><center id='yOkB4'></center></pre></bdo></b><th id='yOkB4'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='yOkB4'><tfoot id='yOkB4'></tfoot><dl id='yOkB4'><fieldset id='yOkB4'></fieldset></dl></div>

              <bdo id='yOkB4'></bdo><ul id='yOkB4'></ul>

              <small id='yOkB4'></small><noframes id='yOkB4'>

                  <tbody id='yOkB4'></tbody>
                <tfoot id='yOkB4'></tfoot>

                  本文介紹了pyspark mysql jdbc load 調用 o23.load 時發生錯誤 沒有合適的驅動程序的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我在 Mac 上使用 docker image sequenceiq/spark 來研究這些spark examples,在學習過程中,我根據這個答案,當我啟動Simple Data Operations 例子,這里是發生了什么:

                  I use docker image sequenceiq/spark on my Mac to study these spark examples, during the study process, I upgrade the spark inside that image to 1.6.1 according to this answer, and the error occurred when I start the Simple Data Operations example, here is what happened:

                  當我運行 df = sqlContext.read.format("jdbc").option("url",url).option("dbtable","people").load() 它引發錯誤,與pyspark控制臺的完整堆棧如下:

                  when I run df = sqlContext.read.format("jdbc").option("url",url).option("dbtable","people").load() it raise a error, and the full stack with the pyspark console is as followed:

                  Python 2.6.6 (r266:84292, Jul 23 2015, 15:22:56)
                  [GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux2
                  Type "help", "copyright", "credits" or "license" for more information.
                  16/04/12 22:45:28 WARN NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
                  Welcome to
                        ____              __
                       / __/__  ___ _____/ /__
                      _\ \/ _ \/ _ `/ __/  '_/
                     /__ / .__/\_,_/_/ /_/\_\   version 1.6.1
                        /_/
                  
                  Using Python version 2.6.6 (r266:84292, Jul 23 2015 15:22:56)
                  SparkContext available as sc, HiveContext available as sqlContext.
                  >>> url = "jdbc:mysql://localhost:3306/test?user=root;password=myPassWord"
                  >>> df = sqlContext.read.format("jdbc").option("url",url).option("dbtable","people").load()
                  16/04/12 22:46:05 WARN Connection: BoneCP specified but not present in CLASSPATH (or one of dependencies)
                  16/04/12 22:46:06 WARN Connection: BoneCP specified but not present in CLASSPATH (or one of dependencies)
                  16/04/12 22:46:11 WARN ObjectStore: Version information not found in metastore. hive.metastore.schema.verification is not enabled so recording the schema version 1.2.0
                  16/04/12 22:46:11 WARN ObjectStore: Failed to get database default, returning NoSuchObjectException
                  16/04/12 22:46:16 WARN Connection: BoneCP specified but not present in CLASSPATH (or one of dependencies)
                  16/04/12 22:46:17 WARN Connection: BoneCP specified but not present in CLASSPATH (or one of dependencies)
                  Traceback (most recent call last):
                    File "<stdin>", line 1, in <module>
                    File "/usr/local/spark/python/pyspark/sql/readwriter.py", line 139, in load
                      return self._df(self._jreader.load())
                    File "/usr/local/spark/python/lib/py4j-0.9-src.zip/py4j/java_gateway.py", line 813, in __call__
                    File "/usr/local/spark/python/pyspark/sql/utils.py", line 45, in deco
                      return f(*a, **kw)
                    File "/usr/local/spark/python/lib/py4j-0.9-src.zip/py4j/protocol.py", line 308, in get_return_value
                  py4j.protocol.Py4JJavaError: An error occurred while calling o23.load.
                  : java.sql.SQLException: No suitable driver
                      at java.sql.DriverManager.getDriver(DriverManager.java:278)
                      at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$$anonfun$2.apply(JdbcUtils.scala:50)
                      at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$$anonfun$2.apply(JdbcUtils.scala:50)
                      at scala.Option.getOrElse(Option.scala:120)
                      at org.apache.spark.sql.execution.datasources.jdbc.JdbcUtils$.createConnectionFactory(JdbcUtils.scala:49)
                      at org.apache.spark.sql.execution.datasources.jdbc.JDBCRDD$.resolveTable(JDBCRDD.scala:120)
                      at org.apache.spark.sql.execution.datasources.jdbc.JDBCRelation.<init>(JDBCRelation.scala:91)
                      at org.apache.spark.sql.execution.datasources.jdbc.DefaultSource.createRelation(DefaultSource.scala:57)
                      at org.apache.spark.sql.execution.datasources.ResolvedDataSource$.apply(ResolvedDataSource.scala:158)
                      at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:119)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                      at java.lang.reflect.Method.invoke(Method.java:606)
                      at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:231)
                      at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:381)
                      at py4j.Gateway.invoke(Gateway.java:259)
                      at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:133)
                      at py4j.commands.CallCommand.execute(CallCommand.java:79)
                      at py4j.GatewayConnection.run(GatewayConnection.java:209)
                      at java.lang.Thread.run(Thread.java:744)
                  
                  >>>
                  

                  這是我迄今為止嘗試過的:

                  Here is what I have tried till now:

                  1. 下載mysql-connector-java-5.0.8-bin.jar,放入/usr/local/spark/lib/.還是一樣的錯誤.

                  1. Download mysql-connector-java-5.0.8-bin.jar, and put it in to /usr/local/spark/lib/. It still the same error.

                  像這樣創建t.py:

                  from pyspark import SparkContext  
                  from pyspark.sql import SQLContext  
                  
                  sc = SparkContext(appName="PythonSQL")  
                  sqlContext = SQLContext(sc)  
                  df = sqlContext.read.format("jdbc").option("url",url).option("dbtable","people").load()  
                  
                  df.printSchema()  
                  countsByAge = df.groupBy("age").count()  
                  countsByAge.show()  
                  countsByAge.write.format("json").save("file:///usr/local/mysql/mysql-connector-java-5.0.8/db.json")  
                  

                  然后,我嘗試了 spark-submit --conf spark.executor.extraClassPath=mysql-connector-java-5.0.8-bin.jar --driver-class-path mysql-connector-java-5.0.8-bin.jar --jars mysql-connector-java-5.0.8-bin.jar --master local[4] t.py.結果還是一樣.

                  then, I tried spark-submit --conf spark.executor.extraClassPath=mysql-connector-java-5.0.8-bin.jar --driver-class-path mysql-connector-java-5.0.8-bin.jar --jars mysql-connector-java-5.0.8-bin.jar --master local[4] t.py. The result is still the same.

                  1. 然后我嘗試了 pyspark --conf spark.executor.extraClassPath=mysql-connector-java-5.0.8-bin.jar --driver-class-path mysql-connector-java-5.0.8-bin.jar --jars mysql-connector-java-5.0.8-bin.jar --master local[4] t.py,有和沒有下面的t.py,還是一樣.
                  1. Then I tried pyspark --conf spark.executor.extraClassPath=mysql-connector-java-5.0.8-bin.jar --driver-class-path mysql-connector-java-5.0.8-bin.jar --jars mysql-connector-java-5.0.8-bin.jar --master local[4] t.py, both with and without the following t.py, still the same.

                  在此期間,mysql 正在運行.這是我的操作系統信息:

                  During all of this, the mysql is running. And here is my os info:

                  # rpm --query centos-release  
                  centos-release-6-5.el6.centos.11.2.x86_64
                  

                  hadoop 版本是 2.6.

                  And the hadoop version is 2.6.

                  現在不知道下一步該去哪里,希望有大神幫忙指點一下,謝謝!

                  Now I don't where to go next, so I hope some one can help give some advice, thanks!

                  推薦答案

                  當我嘗試將腳本寫入 MySQL 時,我遇到了java.sql.SQLException:沒有合適的驅動程序".

                  I ran into "java.sql.SQLException: No suitable driver" when I tried to have my script write to MySQL.

                  這是我為解決這個問題所做的.

                  Here's what I did to fix that.

                  在 script.py 中

                  In script.py

                  df.write.jdbc(url="jdbc:mysql://localhost:3333/my_database"
                                    "?user=my_user&password=my_password",
                                table="my_table",
                                mode="append",
                                properties={"driver": 'com.mysql.jdbc.Driver'})
                  

                  然后我以這種方式運行 spark-submit

                  Then I ran spark-submit this way

                  SPARK_HOME=/usr/local/Cellar/apache-spark/1.6.1/libexec spark-submit --packages mysql:mysql-connector-java:5.1.39 ./script.py
                  

                  請注意,SPARK_HOME 特定于安裝 spark 的位置.對于您的環境,這個 https://github.com/sequenceiq/docker-spark/blob/master/README.md 可能會有所幫助.

                  Note that SPARK_HOME is specific to where spark is installed. For your environment this https://github.com/sequenceiq/docker-spark/blob/master/README.md might help.

                  如果以上所有內容都令人困惑,請嘗試以下操作:
                  在 t.py 中替換

                  In case all the above is confusing, try this:
                  In t.py replace

                  sqlContext.read.format("jdbc").option("url",url).option("dbtable","people").load()
                  

                  sqlContext.read.format("jdbc").option("dbtable","people").option("driver", 'com.mysql.jdbc.Driver').load()
                  

                  然后運行

                  spark-submit --packages mysql:mysql-connector-java:5.1.39 --master local[4] t.py
                  

                  這篇關于pyspark mysql jdbc load 調用 o23.load 時發生錯誤 沒有合適的驅動程序的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函數根據 N 個先前值來決定接下來的 N 個行)
                  reuse the result of a select expression in the quot;GROUP BYquot; clause?(在“GROUP BY中重用選擇表達式的結果;條款?)
                  Does ignore option of Pyspark DataFrameWriter jdbc function ignore entire transaction or just offending rows?(Pyspark DataFrameWriter jdbc 函數的 ignore 選項是忽略整個事務還是只是有問題的行?) - IT屋-程序員軟件開發技
                  Error while using INSERT INTO table ON DUPLICATE KEY, using a for loop array(使用 INSERT INTO table ON DUPLICATE KEY 時出錯,使用 for 循環數組)
                  How to integrate Apache Spark with MySQL for reading database tables as a spark dataframe?(如何將 Apache Spark 與 MySQL 集成以將數據庫表作為 Spark 數據幀讀取?)
                  In Apache Spark 2.0.0, is it possible to fetch a query from an external database (rather than grab the whole table)?(在 Apache Spark 2.0.0 中,是否可以從外部數據庫獲取查詢(而不是獲取整個表)?) - IT屋-程序員軟件開
                  • <i id='bYm30'><tr id='bYm30'><dt id='bYm30'><q id='bYm30'><span id='bYm30'><b id='bYm30'><form id='bYm30'><ins id='bYm30'></ins><ul id='bYm30'></ul><sub id='bYm30'></sub></form><legend id='bYm30'></legend><bdo id='bYm30'><pre id='bYm30'><center id='bYm30'></center></pre></bdo></b><th id='bYm30'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='bYm30'><tfoot id='bYm30'></tfoot><dl id='bYm30'><fieldset id='bYm30'></fieldset></dl></div>
                    <tfoot id='bYm30'></tfoot>

                    <small id='bYm30'></small><noframes id='bYm30'>

                          <bdo id='bYm30'></bdo><ul id='bYm30'></ul>
                            <tbody id='bYm30'></tbody>
                            <legend id='bYm30'><style id='bYm30'><dir id='bYm30'><q id='bYm30'></q></dir></style></legend>
                            主站蜘蛛池模板: 毛片网站免费观看 | 日韩毛片| 一区二区三区精品视频 | 成人综合伊人 | 久久久久久国产精品免费免费 | 免费黄网站在线观看 | 欧美综合一区二区 | 成av在线| 国产成人福利 | 国产国语精品 | 成年人网站免费 | 亚洲国产成人在线视频 | 国产国产精品 | 日本精品视频 | 亚洲国产精品视频 | 欧美涩 | 九九热这里只有精品6 | 精品伊人 | 一区二区三区在线免费观看 | 人人操日日干 | 精品国产网 | 国产伦精品一区二区三区精品视频 | 亚洲免费一区 | 成人精品国产免费网站 | 久久69精品久久久久久久电影好 | 亚洲人的av | 97国产精品视频人人做人人爱 | 国产我和子的乱视频网站 | 91精品久久久久久久久中文字幕 | 97国产超碰 | 欧美日产国产成人免费图片 | 亚洲天堂男人的天堂 | 九九热这里只有精品在线观看 | 国产免费看 | av黄色网 | 欧美久久一区二区 | 欧美视频1区 | 伊人久久综合 | 999精品视频 | 国产欧美一区二区三区久久 | 91精品国产乱码久久久久久久久 |