senthh commented on pull request #34272:
URL: https://github.com/apache/spark/pull/34272#issuecomment-942170973
Sample Output after this changes:
SQL :
<p>mysql> CREATE TABLE Persons(Id int NOT NULL, FirstName varchar(255),
LastName varchar(255), Age int);</p>
<p> </p>
<p>mysql> desc Persons;<br>
<ins>----------<del></del></ins>------------<del><ins></ins></del>----<del></del>---<del><ins></ins></del>-------<del></del>------+</p>
<div class="table-wrap">
Field | Type | Null | Key | Default | Extra
-- | -- | -- | -- | -- | --
Id int NO NULL
FirstName varchar(255) YES NULL
LastName varchar(255) YES NULL
Age int YES NULL
</div>
<p><ins>----------<del></del></ins>------------<del><ins></ins></del>----<del></del>---<del><ins></ins></del>-------<del></del>------+</p>
Spark:
scala> val df =
spark.read.format("jdbc").option("database","Test_DB").option("user",
"root").option("password", "").option("driver",
"com.mysql.cj.jdbc.Driver").option("url",
"jdbc:mysql://localhost:3306/Test_DB").option("dbtable", "Persons").load()
df: org.apache.spark.sql.DataFrame = [Id: int, FirstName: string ... 2 more
fields]
scala> df.printSchema()
root
|-- Id: integer (nullable = false)
|-- FirstName: string (nullable = true)
|-- LastName: string (nullable = true)
|-- Age: integer (nullable = true)
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]