About the Help category

DELIMITER //
CREATE OR REPLACE PROCEDURE audit_trail () AS
BEGIN
DECLARE done INT DEFAULT 0;
DECLARE table_name CHAR(255);
DECLARE column_name CHAR(255);
DECLARE column_type CHAR(255);
DECLARE column_is_nullable CHAR(3);
DECLARE column_default_value TEXT;

DECLARE cur CURSOR FOR 
    SELECT table_name, column_name, data_type, is_nullable, column_default
    FROM information_schema.columns
    WHERE table_schema = DATABASE() AND table_name NOT LIKE 'audit_trail%' AND table_name != 'schema_version';

DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;

OPEN cur;

read_loop: LOOP
    FETCH cur INTO table_name, column_name, column_type, column_is_nullable, column_default_value;
    IF done = 1 THEN
        LEAVE read_loop;
    END IF;

    SET @audit_sql = CONCAT('INSERT INTO audit_trail(table_name, column_name, column_type, column_is_nullable, column_default_value, action) SELECT "', 
            table_name, '", "', column_name, '", "', column_type, '", "', column_is_nullable, '", "', column_default_value, '", "ALTERED" FROM ', 
            table_name, ' WHERE ', column_name, ' IS NOT NULL AND NOT EXISTS (SELECT 1 FROM audit_trail WHERE table_name = "', table_name, 
            '" AND column_name = "', column_name, '" AND column_default_value = "', column_default_value, '" AND action = "ALTERED")');

    PREPARE stmt FROM @audit_sql;
    EXECUTE stmt;
    DEALLOCATE PREPARE stmt;
END LOOP;

CLOSE cur;

END //
DELIMITER ;

Can I know whether the code works or not I have have tested but getting some error unable to find out. Help with resolution

Hi, I recently started working on SingleStore and I am new to this community. I am unable to create post in the help category. I am trying to perform INSERT WHERE NOT EXISTS in singlestore but that is not working. Can someone help me with performing the query

Query - INSERT INTO table(col1) VALUES (‘colValue’) WHERE NOT EXISTS (SELECT 1 from table WHERE col2 = ‘coValue’

Thanks in advance!

Thank you for suggestion, looks good.

Hello, I’m new to the forum. I need to ask a question or even create a new topic. I might be slow, but I can’t seem to find a button anywhere that allows me to do that. If someone from the SingleStore team can verify my access or point me in the right direction I’d appreciate it.

Thanks!

How do I start a new thread to ask a question?

Same problem here. Can’t create a new topic :-/

Hi,
How can I start a new topic?

I’ve got the new user unable to post problem too. I want to post a new thread asking about PIPELINE FS issues and how to best use. Can you give me privileges to make a new topic in Help? Thanks!

@dmartin @tfly I’ve got the new user unable to post problem

Dear Team,

I am trying to read data from singleStore via spark query. Datasize is around 500MB-1GB.
Spark version : 3.3.2
singlestore spark connector version : 4.1.4-spark-3.3.2
scala : 2.12
singlestore-jdbc-client : 1.1.8
singestore : 7.8

        Dataset<Row> data = spark.read().format("singlestore").option("driver", "com.singlestore.jdbc.Driver").option("url", uat_url).option("query", query)
                    .option("ddlEndpoint", ddlEndpoint)
                    .option("user", uat_username)
                    .option("enableParallelRead", "automatic")
                    .option("parallelRead.Features", "readFromAggregatorsMaterialized,readFromAggregators")
                    .option("parallelRead.repartition", "true")                   
                    .option("password", uat_password).load();

        int numPartitionsUsed = data. rdd().getNumPartitions();
        System.out.println("Number of partitions used: " + numPartitionsUsed);

In above code, I am only getting result via single partition. data for table is spread across 20 partition. I have tried using (“numPartitions”, 2) and (“parallelRead.repartition.columns”, “id”) . Still I am getting same output. can you please help me on same ?

Hi
I just signed up as a new user on this forum yest. I came here looking for help.
I’m struggling to understand how discourse works. I’ve been unable to figure out how to create a post. kindly help

Welcome, @himawari!

Try going to SingleStore Forums

Then on the top right, click the button to create a new topic. As a new user, it may be necessary for someone to approve your first post or first few posts.

1 Like

Thank you for the guidance.

Hi
I Need Help on CTE
I’m unable to POST my query on the SingleStore Fourms, didn’t fount any option .

how do I create a new topic?

Anyway, here is my question:

I am looking for an HTAP database to run my transactional web application (an EHR for small clinics) and at the same time run OLAP queries on it.
My question is how is the best practice to approach this. My OLTP tables used by my application obey 3 normal form, with most of the things normalized.
Should I run the OLAP queries in the tables used by the system itself, all normalized?
Or should I create a materialized view with a more normalized (star schema?) design of the fact and dimension tables?
Or should I create a pipeline with some sort of ETL process to have a copy of the data organized in a star schema or as a flat table?
What is the most recommended approach by Singlestore to make use of HTAP?

Hi, I had signed up on this forum a while back looking for some help regarding enabling singestore studio using the singlestore k8s operator, but I could not figure how to create a new post.
I figured it is probably because I may not have the required permissions for it.
Anyway, my query is : how do we enable singlestore studio on singelstore k8s operator.
I had even posted it on stackoverflow but got no help there.
Also, it would be helpful if there is a guide somewhere to help you post a new question.

Hi,
I am newly signed up. I am looking for help. I am unable to create a topic or post .

Kindly help

hi i have created account on singlestoredb…i have database allocated and i have added two tables…i tried to add another table but it has reference key to it…singlestoredb doesnt support reference key but ignore_foreign_key engine variable to on will allow refernece key syntax…but for this i need privileges…even though i created account and i am the owner still i cant privleges to myself…i need privilges to set ignore foreign key…kindly help me with this… I am using free tier…I have checked available grants and I dont have any SUPER or GRANT privileges…kindly grant me privileges so that i can ignore foreign keys

Hi team,

I’m having trouble posting my issue as a new user.

I need to use a Python script in my pipeline to transform my data. Below is a sample Python code hosted on an external server within nginx at domain abc.xyz:

#!/usr/bin/env python
import sys

for line in sys.stdin:
    # Process the line here
    processed_line = line.upper()  # Example: convert to uppercase
    sys.stdout.write(processed_line)

my csv file words.csv

word
hello
world
singlestore
database

I’ve tried creating a table and pipeline but it’s not working. I have super user access.

CREATE TABLE words (
    word VARCHAR(40)
);

CREATE OR REPLACE PIPELINE uppercase
LOAD DATA LINK azurelink 'poc/words/'
BATCH_INTERVAL 3600000
DISABLE OFFSETS METADATA GC
WITH TRANSFORM ('http://abc.xyz/uppercase_transform.py', '', '')
INTO TABLE words
FIELDS TERMINATED BY ',';

Hi
im load data using pipeline and include the skip errors, data loaded but where can i get all the skip data info?