Skip to content
Merged
Changes from all commits
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
7 changes: 6 additions & 1 deletion src/main/scala/tech/sourced/gemini/Hash.scala
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,12 @@ class Hash(session: SparkSession,
val uast = Node.parseFrom(byteArr)
SparkFEClient.extract(uast, feConfig, extractors, Some(skippedFiles))
}
features.map(feat => (feat.name, row.getAs[String]("document"), feat.weight.toLong))
features
// 65535 is the limit for a key in Scylla
// key = (hash mode, feature.name)
// and it's just sane to remove such huge name
.filter(_.name.length < 65530)
.map(feat => (feat.name, row.getAs[String]("document"), feat.weight.toLong))
}
.toDF("feature", "doc", "weight")
}
Expand Down