Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BugFix][Spark] Fix the bug that VertexWrite does not generate vertex count file #110

Merged
merged 4 commits into from
Feb 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions spark/src/test/scala/com/alibaba/graphar/TestWriter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package com.alibaba.graphar

import com.alibaba.graphar.utils.IndexGenerator
import com.alibaba.graphar.writer.{VertexWriter, EdgeWriter}
import com.alibaba.graphar.utils
acezen marked this conversation as resolved.
Show resolved Hide resolved

import org.apache.spark.sql.{DataFrame, SparkSession}
import org.scalatest.funsuite.AnyFunSuite
Expand Down Expand Up @@ -61,11 +62,8 @@ class WriterSuite extends AnyFunSuite {
val chunk_path = new Path(prefix + vertex_info.getPrefix() + "*/*")
val chunk_files = fs.globStatus(chunk_path)
assert(chunk_files.length == 20)
val vertex_num_path = new Path(prefix + vertex_info.getVerticesNumFilePath())
val vertex_num_file = fs.globStatus(vertex_num_path)
assert(vertex_num_file.length == 1)
val input = fs.open(vertex_num_path)
val number = java.lang.Long.reverseBytes(input.readLong())
val vertex_num_path = prefix + vertex_info.getVerticesNumFilePath()
val number = utils.FileSystem.readValue(vertex_num_path, spark.sparkContext.hadoopConfiguration)
assert(number.toInt == vertex_df.count())

assertThrows[IllegalArgumentException](new VertexWriter(prefix, vertex_info, vertex_df))
Expand Down