Skip to content

Commit a736c59

Browse files
committed
Refactor schema definition example by formatting cast call and uncommenting top-10 films query code for improved readability and functionality.
1 parent 81a5b20 commit a736c59

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/main/kotlin/Example_1_Define_schema_manually.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ fun main() {
2525
val dbConfig = DbConnectionConfig(URL, USER_NAME, PASSWORD)
2626

2727
// read the table
28-
val movies = DataFrame.readSqlTable(dbConfig, TABLE_NAME_MOVIES, 10000).cast<Movies>(verify=true)
28+
val movies = DataFrame.readSqlTable(dbConfig, TABLE_NAME_MOVIES, 10000)
29+
.cast<Movies>(verify=true)
2930

3031
// print the dataframe
3132
movies.print()
@@ -36,8 +37,9 @@ fun main() {
3637
print(movies.generateInterfaces("Movies"))
3738

3839
// print names of top-10 rated films
39-
/*movies.sortByDesc { rank }
40+
movies
41+
//.sortByDesc { rank }
4042
.take(10)
4143
.select { name }
42-
.print()*/
44+
.print()
4345
}

0 commit comments

Comments
 (0)