Динамически генерировать case-класс в Scala

Я хочу прочитать довольно большой CSV-файл и обработать его (ломтик, игральные кости, суммирование и т. Д.)interactively (разведка данных). Моя идея - прочитать файл в базу данных (H2) и использовать SQL для его обработки:

Read the file: I use Ostermiller csv parser

Determine the type of each column: I select randomly 50 rows and derive the type (int, long, double, date, string) of each column

I want to use Squeryl to process. To do so I need to create a case class dynamically. That's the bottleneck so far!

I upload the file to H2 and use any SQL command.

Мои вопросы:

Is there a better general interactive way of doing this in Scala? Is there a way to solve the 3rd point? To state it differently, given a list of types (corresponding to the columns in the csv file), is it possible to dynamically create a case class corresponding to the table in Squeryl? To my understanding I can do that using macros, but I do not have enough exposure to do that.

Ответы на вопрос(3)

Ваш ответ на вопрос