@@ -42,7 +42,7 @@ class RateSourceSuite extends StreamTest {
4242 test(" basic" ) {
4343 val input = spark.readStream
4444 .format(" rate" )
45- .option(" tuplesPerSecond " , " 10" )
45+ .option(" rowsPerSecond " , " 10" )
4646 .option(" useManualClock" , " true" )
4747 .load()
4848 testStream(input)(
@@ -56,10 +56,10 @@ class RateSourceSuite extends StreamTest {
5656 )
5757 }
5858
59- test(" uniform distribution of event timestamps: tuplesPerSecond > 1000" ) {
59+ test(" uniform distribution of event timestamps: rowsPerSecond > 1000" ) {
6060 val input = spark.readStream
6161 .format(" rate" )
62- .option(" tuplesPerSecond " , " 1500" )
62+ .option(" rowsPerSecond " , " 1500" )
6363 .option(" useManualClock" , " true" )
6464 .load()
6565 .as[(java.sql.Timestamp , Long )]
@@ -73,10 +73,10 @@ class RateSourceSuite extends StreamTest {
7373 )
7474 }
7575
76- test(" uniform distribution of event timestamps: tuplesPerSecond < 1000" ) {
76+ test(" uniform distribution of event timestamps: rowsPerSecond < 1000" ) {
7777 val input = spark.readStream
7878 .format(" rate" )
79- .option(" tuplesPerSecond " , " 400" )
79+ .option(" rowsPerSecond " , " 400" )
8080 .option(" useManualClock" , " true" )
8181 .load()
8282 .as[(java.sql.Timestamp , Long )]
@@ -92,23 +92,23 @@ class RateSourceSuite extends StreamTest {
9292 test(" valueAtSecond" ) {
9393 import RateStreamSource ._
9494
95- assert(valueAtSecond(seconds = 0 , tuplesPerSecond = 5 , rampUpTimeSeconds = 2 ) === 0 )
96- assert(valueAtSecond(seconds = 1 , tuplesPerSecond = 5 , rampUpTimeSeconds = 2 ) === 1 )
97- assert(valueAtSecond(seconds = 2 , tuplesPerSecond = 5 , rampUpTimeSeconds = 2 ) === 3 )
98- assert(valueAtSecond(seconds = 3 , tuplesPerSecond = 5 , rampUpTimeSeconds = 2 ) === 8 )
99-
100- assert(valueAtSecond(seconds = 0 , tuplesPerSecond = 10 , rampUpTimeSeconds = 4 ) === 0 )
101- assert(valueAtSecond(seconds = 1 , tuplesPerSecond = 10 , rampUpTimeSeconds = 4 ) === 2 )
102- assert(valueAtSecond(seconds = 2 , tuplesPerSecond = 10 , rampUpTimeSeconds = 4 ) === 6 )
103- assert(valueAtSecond(seconds = 3 , tuplesPerSecond = 10 , rampUpTimeSeconds = 4 ) === 12 )
104- assert(valueAtSecond(seconds = 4 , tuplesPerSecond = 10 , rampUpTimeSeconds = 4 ) === 20 )
105- assert(valueAtSecond(seconds = 5 , tuplesPerSecond = 10 , rampUpTimeSeconds = 4 ) === 30 )
95+ assert(valueAtSecond(seconds = 0 , rowsPerSecond = 5 , rampUpTimeSeconds = 2 ) === 0 )
96+ assert(valueAtSecond(seconds = 1 , rowsPerSecond = 5 , rampUpTimeSeconds = 2 ) === 1 )
97+ assert(valueAtSecond(seconds = 2 , rowsPerSecond = 5 , rampUpTimeSeconds = 2 ) === 3 )
98+ assert(valueAtSecond(seconds = 3 , rowsPerSecond = 5 , rampUpTimeSeconds = 2 ) === 8 )
99+
100+ assert(valueAtSecond(seconds = 0 , rowsPerSecond = 10 , rampUpTimeSeconds = 4 ) === 0 )
101+ assert(valueAtSecond(seconds = 1 , rowsPerSecond = 10 , rampUpTimeSeconds = 4 ) === 2 )
102+ assert(valueAtSecond(seconds = 2 , rowsPerSecond = 10 , rampUpTimeSeconds = 4 ) === 6 )
103+ assert(valueAtSecond(seconds = 3 , rowsPerSecond = 10 , rampUpTimeSeconds = 4 ) === 12 )
104+ assert(valueAtSecond(seconds = 4 , rowsPerSecond = 10 , rampUpTimeSeconds = 4 ) === 20 )
105+ assert(valueAtSecond(seconds = 5 , rowsPerSecond = 10 , rampUpTimeSeconds = 4 ) === 30 )
106106 }
107107
108108 test(" rampUpTime" ) {
109109 val input = spark.readStream
110110 .format(" rate" )
111- .option(" tuplesPerSecond " , " 10" )
111+ .option(" rowsPerSecond " , " 10" )
112112 .option(" rampUpTime" , " 4s" )
113113 .option(" useManualClock" , " true" )
114114 .load()
@@ -138,7 +138,7 @@ class RateSourceSuite extends StreamTest {
138138 test(" numPartitions" ) {
139139 val input = spark.readStream
140140 .format(" rate" )
141- .option(" tuplesPerSecond " , " 10" )
141+ .option(" rowsPerSecond " , " 10" )
142142 .option(" numPartitions" , " 6" )
143143 .option(" useManualClock" , " true" )
144144 .load()
@@ -153,15 +153,15 @@ class RateSourceSuite extends StreamTest {
153153 testQuietly(" overflow" ) {
154154 val input = spark.readStream
155155 .format(" rate" )
156- .option(" tuplesPerSecond " , Long .MaxValue .toString)
156+ .option(" rowsPerSecond " , Long .MaxValue .toString)
157157 .option(" useManualClock" , " true" )
158158 .load()
159159 .select(spark_partition_id())
160160 .distinct()
161161 testStream(input)(
162162 AdvanceRateManualClock (2 ),
163163 ExpectFailure [ArithmeticException ](t => {
164- Seq (" overflow" , " tuplesPerSecond " ).foreach { msg =>
164+ Seq (" overflow" , " rowsPerSecond " ).foreach { msg =>
165165 assert(t.getMessage.contains(msg))
166166 }
167167 })
@@ -189,7 +189,7 @@ class RateSourceSuite extends StreamTest {
189189 }
190190 }
191191
192- testIllegalOptionValue(" tuplesPerSecond " , " -1" , Seq (" -1" , " tuplesPerSecond " , " positive" ))
192+ testIllegalOptionValue(" rowsPerSecond " , " -1" , Seq (" -1" , " rowsPerSecond " , " positive" ))
193193 testIllegalOptionValue(" numPartitions" , " -1" , Seq (" -1" , " numPartitions" , " positive" ))
194194 }
195195}
0 commit comments