[ 
https://issues.apache.org/jira/browse/SPARK-25672?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Hyukjin Kwon resolved SPARK-25672.
----------------------------------
       Resolution: Fixed
    Fix Version/s: 3.0.0

Issue resolved by pull request 22666
[https://github.com/apache/spark/pull/22666]

> Inferring schema from CSV string literal
> ----------------------------------------
>
>                 Key: SPARK-25672
>                 URL: https://issues.apache.org/jira/browse/SPARK-25672
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.4.0
>            Reporter: Maxim Gekk
>            Assignee: Maxim Gekk
>            Priority: Minor
>             Fix For: 3.0.0
>
>
> Need to add new function - *schema_of_csv()*. The function should infer 
> schema of CSV string literal. The result of the function is a schema in DDL 
> format.
> One of the use cases is passing output of _schema_of_csv()_ to *from_csv()* 
> (see SPARK-25393). The new function should allow schema inferring from an 
> example. Let's say csv_col is a column containing CSV string with the same 
> schema. It should be possible to pass a CSV string with the same schema to 
> _schema_of_csv()_ which infers schema for the particular example.
> {code:sql}
> select from_csv(csv_col, schema_of_csv('1,a,0.1'))
> from csv_table;
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to