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

    https://github.com/apache/flink/pull/4355#discussion_r135121779
  
    --- Diff: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/aggregate/AggregateUtil.scala
 ---
    @@ -1469,4 +1526,26 @@ object AggregateUtil {
       private def gcd(a: Long, b: Long): Long = {
         if (b == 0) a else gcd(b, a % b)
       }
    +
    +  @throws[Exception]
    +  def serialize(stateDescriptor: StateDescriptor[_, _]): String = {
    +    val byteArray = InstantiationUtil.serializeObject(stateDescriptor)
    +    Base64.encodeBase64URLSafeString(byteArray)
    +  }
    +
    +  @throws[Exception]
    +  def deserialize(data: String): StateDescriptor[_, _] = {
    +    val byteData = Base64.decodeBase64(data)
    +    InstantiationUtil.deserializeObject[StateDescriptor[_, _]](
    +      byteData,
    +      Thread.currentThread.getContextClassLoader)
    +  }
    +
    +  def createDataViewTerm(aggIndex: Int, fieldName: String): String = {
    +    s"acc${aggIndex}_${fieldName}_dataview"
    +  }
     }
    +
    +case class DataViewConfig(accSpecs: Array[Seq[DataViewSpec[_]]], 
isStateBackedDataViews: Boolean)
    --- End diff --
    
    We only need a `DataViewConfig` if the views are backed by state right? So 
we can remove the `boolean` `isStateBackedDataViews` field and make it an 
optional parameter of the code generator.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to