Skip to content

Commit

Permalink
fix post-revert build
Browse files Browse the repository at this point in the history
  • Loading branch information
yliuuuu committed Jul 25, 2024
1 parent 8c354c6 commit ee56403
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1734,6 +1734,14 @@ internal class PartiQLPigVisitor(
return com.amazon.ionelement.api.metaContainerOf(Pair(metas.tag, metas))
}

private fun List<Token>.getSourceMetaContainer(): MetaContainer {
val base = this.firstOrNull() ?: return emptyMetaContainer()
val length = this.fold(0) { acc, token ->
acc + token.stopIndex - token.startIndex + 1
}
return metaContainerOf(SourceLocationMeta(base.line.toLong(), base.charPositionInLine.toLong() + 1, length.toLong()))
}

private fun TerminalNode.getSourceMetas(): SourceLocationMeta = this.symbol.getSourceMetas()

private fun Token.getSourceMetas(): SourceLocationMeta {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ internal class PartiQLParserDefault : PartiQLParser {
}

override fun visitColumnDeclaration(ctx: GeneratedParser.ColumnDeclarationContext) = translate(ctx) {
val name = visitSymbolPrimitive(ctx.columnName().symbolPrimitive())
val name = visitSymbolPrimitive(ctx.columnName().symbolPrimitive()).symbol
val type = visit(ctx.type()) as Type
val constraints = ctx.columnConstraint().map {
visitColumnConstraint(it)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ internal object SqlTypes {
}
is Type.Any -> dynamic()
is Type.List -> array()
is Type.Array -> array(type.type?.let { from(it) })
is Type.Tuple -> struct()
is Type.Struct -> struct()
is Type.Custom -> TODO("Custom type not supported ")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -852,10 +852,6 @@ internal object RexConverter {
is Type.Custom -> TODO("Custom type not supported ")
is Type.List -> PType.typeList()
is Type.Tuple -> PType.typeStruct()
is Type.Array -> when (type.type) {
null -> PType.typeList()
else -> PType.typeList(visitType(type.type!!))
}
is Type.Struct -> PType.typeStruct()
}.toCType()
}
Expand Down

0 comments on commit ee56403

Please sign in to comment.