@@ -48,12 +48,11 @@ import org.junit.Test
4848import java.io.ByteArrayInputStream
4949import java.io.ByteArrayOutputStream
5050import java.io.File
51- import java.net.URI
5251import java.net.URL
5352import java.nio.channels.Channels
54- import java.nio.file.FileSystems
5553import java.sql.DriverManager
5654import java.util.Locale
55+ import kotlin.io.path.toPath
5756import kotlin.reflect.typeOf
5857
5958internal class ArrowKtTest {
@@ -658,9 +657,11 @@ internal class ArrowKtTest {
658657
659658 @Test
660659 fun testReadParquetPath () {
661- val resourceLocation = testResource(" test.arrow.parquet" ).path
662- val resourcePath = FileSystems .getDefault().getPath(resourceLocation)
660+ val resourceUrl = testResource(" test.arrow.parquet" )
661+ val resourcePath = resourceUrl.toURI().toPath()
662+
663663 val dataFrame = DataFrame .readParquet(resourcePath)
664+
664665 dataFrame.rowsCount() shouldBe 300
665666 assertEstimations(
666667 exampleFrame = dataFrame,
@@ -672,9 +673,11 @@ internal class ArrowKtTest {
672673
673674 @Test
674675 fun testReadParquetFile () {
675- val resourceLocation = testResource(" test.arrow.parquet" ).path
676- val resourcePath = FileSystems .getDefault().getPath(resourceLocation)
676+ val resourceUrl = testResource(" test.arrow.parquet" )
677+ val resourcePath = resourceUrl.toURI().toPath()
678+
677679 val dataFrame = DataFrame .readParquet(resourcePath.toFile())
680+
678681 dataFrame.rowsCount() shouldBe 300
679682 assertEstimations(
680683 exampleFrame = dataFrame,
@@ -686,9 +689,11 @@ internal class ArrowKtTest {
686689
687690 @Test
688691 fun testReadParquetStringPath () {
689- val resourceLocation = testResource(" test.arrow.parquet" ).path
690- val resourcePath = FileSystems .getDefault().getPath(resourceLocation)
692+ val resourceUrl = testResource(" test.arrow.parquet" )
693+ val resourcePath = resourceUrl.toURI().toPath()
694+
691695 val dataFrame = DataFrame .readParquet(" $resourcePath " )
696+
692697 dataFrame.rowsCount() shouldBe 300
693698 assertEstimations(
694699 exampleFrame = dataFrame,
@@ -700,10 +705,12 @@ internal class ArrowKtTest {
700705
701706 @Test
702707 fun testReadParquetUrl () {
703- val resourceLocation = testResource(" test.arrow.parquet" ).path
704- val resourcePath = FileSystems .getDefault().getPath(resourceLocation)
705- val fileUrl = URI .create(" file:$resourcePath " ).toURL()
708+ val resourceUrl = testResource(" test.arrow.parquet" )
709+ val resourcePath = resourceUrl.toURI().toPath()
710+ val fileUrl = resourcePath.toUri().toURL()
711+
706712 val dataFrame = DataFrame .readParquet(fileUrl)
713+
707714 dataFrame.rowsCount() shouldBe 300
708715 assertEstimations(
709716 exampleFrame = dataFrame,
@@ -715,9 +722,11 @@ internal class ArrowKtTest {
715722
716723 @Test
717724 fun testReadMultipleParquetFiles () {
718- val resourceLocation = testResource(" test.arrow.parquet" ).path
719- val resourcePath = FileSystems .getDefault().getPath(resourceLocation)
725+ val resourceUrl = testResource(" test.arrow.parquet" )
726+ val resourcePath = resourceUrl.toURI().toPath()
727+
720728 val dataFrame = DataFrame .readParquet(resourcePath, resourcePath, resourcePath)
729+
721730 dataFrame.rowsCount() shouldBe 900
722731 }
723732}
0 commit comments