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
New Contributor III

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. 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group