Skip to content

Instantly share code, notes, and snippets.

@shivam-880
Last active July 18, 2022 09:15
Show Gist options
  • Save shivam-880/9094e2fdae4a812b5b34eb8a846670e8 to your computer and use it in GitHub Desktop.
Save shivam-880/9094e2fdae4a812b5b34eb8a846670e8 to your computer and use it in GitHub Desktop.
trait ValueVector {
def allocateNew()
}
abstract class BaseFixedWidthVector extends ValueVector {
def allocateNew() {
// impl
}
}
class IntVector extends BaseFixedWidthVector
abstract class BaseVariableWidthVector extends ValueVector {
def allocateNew() {
// impl
}
}
class VarCharVector extends BaseVariableWidthVector
val intVector: ValueVector = new IntVector()
val strVector: ValueVector = new VarCharVector()
intVector.allocateNew()
strVector.allocateNew()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment