Skip to content

Commit

Permalink
Specs now pass!
Browse files Browse the repository at this point in the history
  • Loading branch information
absurdfarce committed Jun 17, 2020
1 parent b134265 commit 53f6800
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,15 @@ case class DefaultTableDef(keyspaceName: String,
val clusteringColumnNames = clusteringColumns.map(_.columnName).map(quote)
val primaryKeyClause = (partitionKeyClause +: clusteringColumnNames).mkString(", ")
val addIfNotExists = if (ifNotExists) "IF NOT EXISTS " else ""
val clusterOrder = if (clusteringColumns.isEmpty ||
clusteringColumns.forall(x => x.sortingDirection == ClusteringColumn.Ascending)) {
Seq()
} else {
Seq("CLUSTERING ORDER BY (" + clusteringColumns.map(x=> quote(x.columnName) +
" " + x.sortingDirection).mkString(", ") + ")")
}
val clusterOrder =
if (clusteringColumns.isEmpty ||
clusteringColumns.forall(
x => x.sortingDirection.getOrElse(() => "") == ClusteringColumn.Ascending))
Seq()
else
Seq("CLUSTERING ORDER BY (" + clusteringColumns.map(x=> quote(x.columnName) +
" " + x.sortingDirection.getOrElse(() => "")).mkString(", ") + ")")

val allOptions = clusterOrder ++ options.map(x => x._1 + " = " + x._2)
val allOptionsStr = if (allOptions.isEmpty)
""
Expand Down

0 comments on commit 53f6800

Please sign in to comment.