Github user davies commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12440#discussion_r60105297
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/codegen/CodeGenerator.scala
 ---
    @@ -267,6 +267,38 @@ class CodegenContext {
       }
     
       /**
    +   * Returns the specialized code to set a given value in a column vector 
for a given `DataType`.
    +   */
    +  def setValue(batch: String, row: String, dataType: DataType, ordinal: 
Int,
    +      value: String): String = {
    +    val jt = javaType(dataType)
    +    dataType match {
    +      case _ if isPrimitiveType(jt) =>
    +        s"$batch.column($ordinal).put${primitiveTypeName(jt)}($row, 
$value);"
    +      case t: DecimalType => s"$batch.column($ordinal).putDecimal($row, 
$value, ${t.precision});"
    +      case t: StringType => s"$batch.column($ordinal).putByteArray($row, 
$value.getBytes());"
    +      case _ => throw new IllegalArgumentException("cannot generate code 
for unsupported type")
    +    }
    +  }
    +
    +  /**
    +   * Returns the specialized code to access a value from a column vector 
for a given `DataType`.
    +   */
    +  def getValue(batch: String, row: String, dataType: DataType, ordinal: 
Int): String = {
    --- End diff --
    
    Should this just be `getValue(s"$batch.column($ordinal)", dataTpye, row)` ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to