Stop a pipeline

Hi,

We are using pipelines in our product. My question is around stopping the pipeline.

We are using the command:

STOP PIPELINE IF RUNNING resources;

This works fine if the pipeline exists. But if the pipeline doesn’t exist (maybe to an error while deploying liquibase or for some other reason), it throws the error:

ERROR 1944 (HY000) at line 1: Pipeline `resources` does not exist

Is there was way so that I can check if pipeline exists and then stop it
i.e. something like IF EXISTS ?

Hello ngarg! While I contact support to help you with this, can you tell me if you are on a managed or self-hosted service and what version number?

Hi Maria,

We use self managed memsql cluster.
SingleStore DB Version: 7.6.5

Thanks!

You can query information_schema.pipelines to see if it exists, and use conditional logic, either in your app, or with an anonymous code block.

Thanks for your response @hanson .

Will try to have this checked in my Python script. Will revert if any issues.

Thanks again!

1 Like

Hi,

I got started on my python script and I am trying to connect to memsql (running as docker container - cluster-in-a-box). I am using Python3.9.

Here is the code snippet:

from memsql.common import database

conn = database.connect(host="127.0.0.1", port=3306, user="root")
print(conn.query("show databases"))

When i run this, I am getting the following error:

Traceback (most recent call last):
  File "/Users/ngarg/PycharmProjects/memsqlKafka/startup_try.py", line 3, in <module>
    conn = database.connect(host="127.0.0.1", port=3306, user="root")
  File "/Users/ngarg/Library/Python/3.9/lib/python/site-packages/memsql/common/database.py", line 19, in connect
    return Connection(*args, **kwargs)
  File "/Users/ngarg/Library/Python/3.9/lib/python/site-packages/memsql/common/database.py", line 62, in __init__
    self.reconnect()
  File "/Users/ngarg/Library/Python/3.9/lib/python/site-packages/memsql/common/database.py", line 93, in reconnect
    conn = _mysql.connect(**self._db_args)
TypeError: 'db' is an invalid keyword argument for connect()

Try to google this, but didn’t find anything. I am blocked on this step.Any help is appreciated.
(Code referred from Python · SingleStore Documentation)