cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Is Limit input rate Docs not correct?

Jcowell
New Contributor II

In databricks docs it says 

"If you use maxBytesPerTrigger in conjunction with maxFilesPerTrigger, the micro-batch processes data until either the maxFilesPerTrigger or maxBytesPerTrigger limit is reached."

But based on the source code this is not true.

 

 

 

val maxBytesPerTrigger: Option[Long] = parameters.get("maxBytesPerTrigger").map { str =>
    Try(str.toLong).toOption.filter(_ > 0).map(op =>
      if (maxFilesPerTrigger.nonEmpty) {
        throw new IllegalArgumentException(
          "Options 'maxFilesPerTrigger' and 'maxBytesPerTrigger' " +
            "can't be both set at the same time")
      } else op
    ).getOrElse {
      throw new IllegalArgumentException(
        s"Invalid value '$str' for option 'maxBytesPerTrigger', must be a positive integer")
    }
  }

 

 

 

Am i missing something here? 

 

2 REPLIES 2

ozaaditya
Contributor

In my opinion, the reason for not using both options simultaneously is that the framework would face a logical conflict:

  1. Should it stop reading after the maximum number of files is reached, even if the size limit hasn’t been exceeded?
    Or
  2. Should it stop processing when the size limit is reached, even if the file count is below the limit?

Handling these scenarios would add unnecessary complexity to the framework.

Jcowell
New Contributor II

I'm not too concern with whether or not they should be used simultaneously as much as the docs saying somethign to be true when the code shows it is not possible. 

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now