yes indeed Russell, a silly mistake by me.

Thanks



   view my Linkedin profile
<https://www.linkedin.com/in/mich-talebzadeh-ph-d-5205b2/>



*Disclaimer:* Use it at your own risk. Any and all responsibility for any
loss, damage or destruction of data or any other property which may arise
from relying on this email's technical content is explicitly disclaimed.
The author will in no case be liable for any monetary damages arising from
such loss, damage or destruction.




On Wed, 21 Apr 2021 at 23:42, Russell Spitzer <russell.spit...@gmail.com>
wrote:

> Callable means you tried to treat a field as a function like in the
> following example
>
> >>> fun = True
> >>> fun()
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> TypeError: 'bool' object is not callable
>
> My guess is that "isStreaming" is a bool, and in your syntax you used it
> as a function "isStreaming()"
>
> On Wed, Apr 21, 2021 at 5:35 PM Mich Talebzadeh <mich.talebza...@gmail.com>
> wrote:
>
>> Hi,
>>
>> I am testing something in Spark Structured Streaming, this is a new topic
>>
>>  Typical kafka json row
>>
>>       dummy2 = StructType().add("uuid", StringType()).add("timecreated",
>> TimestampType()).add("status", StringType())
>>
>> # example
>> ##856095c6-cdec-485b-9da6-d78275bc0a25
>> {"uuid":"856095c6-cdec-485b-9da6-d78275bc0a25",
>> "timecreated":"2021-04-21T23:29:16", "status":true"}
>>
>>   Created the Streaming read
>>
>>
>>  streamingDummy = self.spark \
>>                 .readStream \
>>                 .format("kafka") \
>>                 .option("kafka.bootstrap.servers",
>> config['MDVariables']['bootstrapServers'],) \
>>                 .option("schema.registry.url",
>> config['MDVariables']['schemaRegistryURL']) \
>>                 .option("group.id", config['common']['dummy']) \
>>                 .option("zookeeper.connection.timeout.ms",
>> config['MDVariables']['zookeeperConnectionTimeoutMs']) \
>>                 .option("rebalance.backoff.ms",
>> config['MDVariables']['rebalanceBackoffMS']) \
>>                 .option("zookeeper.session.timeout.ms",
>> config['MDVariables']['zookeeperSessionTimeOutMs']) \
>>                 .option("auto.commit.interval.ms",
>> config['MDVariables']['autoCommitIntervalMS']) \
>>                 .option("subscribe", config['MDVariables']['topicdummy'])
>> \
>>                 .option("failOnDataLoss", "false") \
>>                 .option("includeHeaders", "true") \
>>                 .option("startingOffsets", "latest") \
>>                 .load() \
>>                 .select(from_json(col("value").cast("string"),
>> dummy2).alias("dummy_value"))
>>
>>             streamingDummy.printSchema()
>>                   *print(streamingDummy.isStreaming())*
>>
>> When I run it I get
>>
>>
>> root
>>
>>  |-- dummy_value: struct (nullable = true)
>>
>>  |    |-- uuid: string (nullable = true)
>>
>>  |    |-- timecreated: timestamp (nullable = true)
>>
>>  |    |-- status: string (nullable = true)
>>
>>
>> *'bool' object is not callable, quitting*
>>
>> I cannot figure out the last line!
>>
>>
>> Thanks
>>
>>
>>    view my Linkedin profile
>> <https://www.linkedin.com/in/mich-talebzadeh-ph-d-5205b2/>
>>
>>
>>
>> *Disclaimer:* Use it at your own risk. Any and all responsibility for
>> any loss, damage or destruction of data or any other property which may
>> arise from relying on this email's technical content is explicitly
>> disclaimed. The author will in no case be liable for any monetary damages
>> arising from such loss, damage or destruction.
>>
>>
>>
>

Reply via email to