<?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>topic Re: java.lang.NoClassDefFoundError: org/apache/spark/internal/Logging$class Error on writing a dataframe to a SQL DB in azure in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/java-lang-noclassdeffounderror-org-apache-spark-internal-logging/m-p/12083#M6942</link>
    <description>&lt;P&gt;Hi @shafana Roohi Jahubar​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope all is well! Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We'd love to hear from you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Sep 2022 10:07:18 GMT</pubDate>
    <dc:creator>Vidula</dc:creator>
    <dc:date>2022-09-20T10:07:18Z</dc:date>
    <item>
      <title>java.lang.NoClassDefFoundError: org/apache/spark/internal/Logging$class Error on writing a dataframe to a SQL DB in azure</title>
      <link>https://community.databricks.com/t5/data-engineering/java-lang-noclassdeffounderror-org-apache-spark-internal-logging/m-p/12079#M6938</link>
      <description>&lt;P&gt;I have to write the extracted data from XML to DB , i am using Dataframe for transformation and trying to load that to DB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have installed these libraries,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;com.databricks:spark-xml_2.12:0.15.0&lt;/P&gt;&lt;P&gt;com.microsoft.azure:spark-mssql-connector_2.11_2.4:1.0.2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and my cell has the below code ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;df_Driver.write.format("com.microsoft.sqlserver.jdbc.spark").option("url", jdbcUrl).mode("overwrite").option("dbtable", "table_name").option("user", jdbcUsername).option("password", jdbcPassword).save()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but it throws an error as&lt;/P&gt;&lt;P&gt;java.lang.NoClassDefFoundError: org/apache/spark/internal/Logging$class&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Py4JJavaError: An error occurred while calling o1055.save.&lt;/P&gt;&lt;P&gt;: java.lang.NoClassDefFoundError: org/apache/spark/internal/Logging$class&lt;/P&gt;&lt;P&gt;at com.microsoft.sqlserver.jdbc.spark.DefaultSource.&amp;lt;init&amp;gt;(DefaultSource.scala:32)&lt;/P&gt;&lt;P&gt;at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)&lt;/P&gt;&lt;P&gt;at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)&lt;/P&gt;&lt;P&gt;at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)&lt;/P&gt;&lt;P&gt;at java.lang.reflect.Constructor.newInstance(Constructor.java:423)&lt;/P&gt;&lt;P&gt;at java.lang.Class.newInstance(Class.java:442)&lt;/P&gt;&lt;P&gt;at org.apache.spark.sql.execution.datasources.DataSource$.lookupDataSourceV2(DataSource.scala:809)&lt;/P&gt;&lt;P&gt;at org.apache.spark.sql.DataFrameWriter.lookupV2Provider(DataFrameWriter.scala:983)&lt;/P&gt;&lt;P&gt;at org.apache.spark.sql.DataFrameWriter.saveInternal(DataFrameWriter.scala:293)&lt;/P&gt;&lt;P&gt;at org.apache.spark.sql.DataFrameWriter.save(DataFrameWriter.scala:258)&lt;/P&gt;&lt;P&gt;at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)&lt;/P&gt;&lt;P&gt;at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)&lt;/P&gt;&lt;P&gt;at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)&lt;/P&gt;&lt;P&gt;at java.lang.reflect.Method.invoke(Method.java:498)&lt;/P&gt;&lt;P&gt;at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244)&lt;/P&gt;&lt;P&gt;at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:380)&lt;/P&gt;&lt;P&gt;at py4j.Gateway.invoke(Gateway.java:295)&lt;/P&gt;&lt;P&gt;at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132)&lt;/P&gt;&lt;P&gt;at py4j.commands.CallCommand.execute(CallCommand.java:79)&lt;/P&gt;&lt;P&gt;at py4j.GatewayConnection.run(GatewayConnection.java:251)&lt;/P&gt;&lt;P&gt;at java.lang.Thread.run(Thread.java:748)&lt;/P&gt;&lt;P&gt;Caused by: java.lang.ClassNotFoundException: org.apache.spark.internal.Logging$class&lt;/P&gt;&lt;P&gt;at java.net.URLClassLoader.findClass(URLClassLoader.java:382)&lt;/P&gt;&lt;P&gt;at java.lang.ClassLoader.loadClass(ClassLoader.java:419)&lt;/P&gt;&lt;P&gt;at com.databricks.backend.daemon.driver.ClassLoaders$LibraryClassLoader.loadClass(ClassLoaders.scala:151)&lt;/P&gt;&lt;P&gt;at java.lang.ClassLoader.loadClass(ClassLoader.java:352)&lt;/P&gt;&lt;P&gt;... 21 more&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help me with this issue. TIA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 11:43:31 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/java-lang-noclassdeffounderror-org-apache-spark-internal-logging/m-p/12079#M6938</guid>
      <dc:creator>Sha_1890</dc:creator>
      <dc:date>2022-07-28T11:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: java.lang.NoClassDefFoundError: org/apache/spark/internal/Logging$class Error on writing a dataframe to a SQL DB in azure</title>
      <link>https://community.databricks.com/t5/data-engineering/java-lang-noclassdeffounderror-org-apache-spark-internal-logging/m-p/12080#M6939</link>
      <description>&lt;P&gt;To write to Azure SQL you don't need to install the driver just use:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;jdbcUrl = "jdbc:sqlserver://{0}:{1};database={2};user={3};password={4}".format(jdbcHostname, jdbcPort, jdbcDatabase, username, password)
&amp;nbsp;
(df
.write
.jdbc(jdbcUrl, "table_name"))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 11:24:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/java-lang-noclassdeffounderror-org-apache-spark-internal-logging/m-p/12080#M6939</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-07-29T11:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: java.lang.NoClassDefFoundError: org/apache/spark/internal/Logging$class Error on writing a dataframe to a SQL DB in azure</title>
      <link>https://community.databricks.com/t5/data-engineering/java-lang-noclassdeffounderror-org-apache-spark-internal-logging/m-p/12081#M6940</link>
      <description>&lt;P&gt;Thanks, its working now. But I have got another issue that the data in dataframe save as a new table instead of inserting the data into existing table in DB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;df&lt;/P&gt;&lt;P&gt;  .write&lt;/P&gt;&lt;P&gt;  .format("jdbc")\&lt;/P&gt;&lt;P&gt;&amp;nbsp;.option("url", jdbcUrl)\&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;.mode("overwrite")\&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;.option("dbtable","Driver_DVCSD")\&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;.option("user", jdbcUsername)\&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;.option("password", jdbcPassword).save()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The dataframe hold the XML data and the table  has audit columns created_date and created_by which  is been dropped when the data is written from the dataframe to table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2022 15:42:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/java-lang-noclassdeffounderror-org-apache-spark-internal-logging/m-p/12081#M6940</guid>
      <dc:creator>Sha_1890</dc:creator>
      <dc:date>2022-07-29T15:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: java.lang.NoClassDefFoundError: org/apache/spark/internal/Logging$class Error on writing a dataframe to a SQL DB in azure</title>
      <link>https://community.databricks.com/t5/data-engineering/java-lang-noclassdeffounderror-org-apache-spark-internal-logging/m-p/12082#M6941</link>
      <description>&lt;P&gt;Hi @shafana Roohi Jahubar​&amp;nbsp;Could you please check the table name in your write command? If it is the same, overwrite mode should overwrite that table.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2022 20:41:40 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/java-lang-noclassdeffounderror-org-apache-spark-internal-logging/m-p/12082#M6941</guid>
      <dc:creator>Noopur_Nigam</dc:creator>
      <dc:date>2022-08-30T20:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: java.lang.NoClassDefFoundError: org/apache/spark/internal/Logging$class Error on writing a dataframe to a SQL DB in azure</title>
      <link>https://community.databricks.com/t5/data-engineering/java-lang-noclassdeffounderror-org-apache-spark-internal-logging/m-p/12083#M6942</link>
      <description>&lt;P&gt;Hi @shafana Roohi Jahubar​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope all is well! Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We'd love to hear from you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 10:07:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/java-lang-noclassdeffounderror-org-apache-spark-internal-logging/m-p/12083#M6942</guid>
      <dc:creator>Vidula</dc:creator>
      <dc:date>2022-09-20T10:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: java.lang.NoClassDefFoundError: org/apache/spark/internal/Logging$class Error on writing a dataframe to a SQL DB in azure</title>
      <link>https://community.databricks.com/t5/data-engineering/java-lang-noclassdeffounderror-org-apache-spark-internal-logging/m-p/12084#M6943</link>
      <description>&lt;P&gt;just add this audit columns as new standard ones in dataframe using .withColumn&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 10:35:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/java-lang-noclassdeffounderror-org-apache-spark-internal-logging/m-p/12084#M6943</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-09-20T10:35:21Z</dc:date>
    </item>
  </channel>
</rss>

