避免在pyspark中阅读csv时将列值溢出到其他列

e4yzc0pl  于 12个月前  发布在  Spark
关注(0)|答案(1)|浏览(111)

我有一个9 GB的csv,并试图在pyspark中读取,下面是csv一行和一列的值-
|nature_of_suit|posture|syllabus|headnotes|summary|disposition|correction|doc_id|
| | |<p>In May, 1873, a brewer pays to the collector |100 as special tax, for which a special-lax stamp is issued to him. Subsequently, he simes lo the satisfaction of the Commissioner of Internal Tevenne that he was not a brewer of more than 500 barrels, and hence that he is entitled to have $50 refunded. The Commissioner issues his certificate for a special-tax stamp of the value of $50 returned. The Treasury ref uses payment of the certificate. The brewer brings his action to recover the amount thereof.</p> <p>Tlie court helow holds : (1) That the Commissioner, being authorized to refund taxes “unjustly assessed or excessive in amount” (Rev. Stat., §3220)- and the value of stamps “where the rates of duties represented thereby have been paid in error or remitted” (id., § 3426), it is immaterial whether his certificate was in one form or the other; (2) That the Court of Claims has jurisdiction of a case founded on the award of a revenue officer in • a matter of which he has jurisdiction and the Treasury has refused to-pay the award. Judgment for the claimant. The defendants appeal.</p> <p>The judgment of the court below is affirmed. The Supreme Court now holds: (1) That the award of the Commissioner, not being- impeached, was conclusive ; (2) That the Court of Claims has jurisdiction of such cases.</p>|<p>KAUFMAN’S CASE.</p>|<p>On the defendants1 Appeal.</p>| | |65862636|
我试了以下几个选项--
df=spark.read.format("csv").option("header",True).option("inferSchema",True).option("multiLine",True).load("2023-08-31.csv")
但低于产量-
|nature_of_suit|posture|syllabus|headnotes|summary|disposition|correction|doc_id|
|null |null |"<p>In May, 1873, a brewer pays to the collector $100 as special tax, for which a special-tax stamp is issued to Mm. Subsequently he shoivs to. the satisfaction of the Commissions)' of Internal Revenue that he was not a brewer of more than 500 barrels, and henee that he is entitled to have $50 refunded. The Commissioner issues his certificate for a special-tax stamp of the value of%50 returned. The Treasury refuses payment of the certificate. The breioe)' brings his action to recover the amount thereof.</p> <p>I. The Commissioner of Internal Revenue being authorized by one section of the statutes (Rev. Stat., § 3220) to refund taxes “unjustly assessed or excessive in, amount,"" and by another| (§ 3426 |) the value of special-tax stamps ‘‘where the rates of duties represented thereby have been paid in error or remitted|"" it is immaterial whether his certificate be in form under the one section or the other so long as it represents a case where the Commissioner is authorized to refund and the amoirnt which the party is entitled to have refunded.</p> <p>II. When a controversy under the revenue laws is by law required to be determined by other officers and other tribunals| and exhausted his jurisdiction|null |
问题似乎是在','逗号处分裂,因此在列中给出了错误的值。
预期产出-
|nature_of_suit|posture|syllabus|headnotes|summary|disposition|correction|doc_id|
|null|null|<p>In May, 1873, a brewer pays to the collector |100 as special tax, for which a special-lax stamp is issued to him. Subsequently, he simes lo the satisfaction of the Commissioner of Internal Tevenne that he was not a brewer of more than 500 barrels, and hence that he is entitled to have $50 refunded. The Commissioner issues his certificate for a special-tax stamp of the value of $50 returned. The Treasury ref uses payment of the certificate. The brewer brings his action to recover the amount thereof.</p> <p>Tlie court helow holds : (1) That the Commissioner, being authorized to refund taxes “unjustly assessed or excessive in amount” (Rev. Stat., §3220)- and the value of stamps “where the rates of duties represented thereby have been paid in error or remitted” (id., § 3426), it is immaterial whether his certificate was in one form or the other; (2) That the Court of Claims has jurisdiction of a case founded on the award of a revenue officer in • a matter of which he has jurisdiction and the Treasury has refused to-pay the award. Judgment for the claimant. The defendants appeal.</p> <p>The judgment of the court below is affirmed. The Supreme Court now holds: (1) That the award of the Commissioner, not being- impeached, was conclusive ; (2) That the Court of Claims has jurisdiction of such cases.</p>|<p>KAUFMAN’S CASE.</p>|<p>On the defendants1 Appeal.</p>|null|null|65862636|
如果你能帮忙的话,我将不胜感激。

ws51t4hk

ws51t4hk1#

我通过添加以下选项使其工作-
df=spark.read.format(“csv”).option(“header”,True).option(“inferSchema”,True). option(“multiLine”,True).option(“quote”,").option(“escape”,”).load(“2023-08-31.csv”)

相关问题