About the Help category

Have a question? Don’t scratch your head too long about it and use this help category to get quick answers from a team member or fellow community member. We’re here to support and guide; whether about SingleStore managed service, self hosted, the forum or other community initiatives.

We are new SingleStore Connect Partners. We’d like to find a few developers to test our integration and app creation process. What would be the best place to post this without selling. We are looking for product feedback only. Thanks.

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.

I can’t tell if it’s because I don’t have the permissions as a new user or if it’s because discourse has terrible non intuitive UX.

I’m trying to construct an sql query - this is something I can express very easily in postgres or spark sql, but I’m unable to construct this query in memsql, haven’t been able to find much help in the docs. Pls help

  1. How can ask this question and where should I post this query? I don’t get discourse at all.
  2. Should I just go to stackoverflow instead ?

Hello @ashriram and welcome to the forums.

I just verified that you should be able to create a new topic. Can you please try again? Reply to me here if Discourse still won’t allow you to create a topic and I’ll see if there’s something on the back end that’s stopping you.

Hey I am looking for help / clarification how to use lateral joins in SingleStore.

Here is the example that would work for postreSQL:

select * from information_schema.tables s
, lateral (
select s.table_name – normally here I would put complex function processing for each element from the table
) t
limit 10

That is very useful for developers and I cannot achieve same for single store.

Best regards
Julian Rogozinski

Hey, I am looking for help / clarification how to achieve string split to see the result as table.

For example that is returning 3 rows in SQL server:
SELECT * FROM STRING_SPLIT(‘Thomas,Mary,Stan’, ‘,’);

That is returning same in posgreSQL:
SELECT unnest(string_to_array(‘Thomas,Mary,Stan’, ‘,’)) AS parts

Please share syntax for Single Store.

Hey I am looking for help / clarification how to use or if you support “from values” syntax in SingleStore.

That would work for postgreSQL and SQL Server:

select * from (values
(1),(5),(10))s(col)

That is quite often used by the developers and quite a limitation for Single Store.

Hello Julian, Try

select * from Table(split(“Thomas,Mary,Stan”,“,”));
±-----------------------------+
| table_col |
±-----------------------------+
| Thomas |
| Mary |
| Stan |
±-----------------------------+

1 Like

Hello Julian

At this point there is no direct function like lateral or Cross Apply & we are planning to have it as a general purpose feature in some point in time in future.

Can we have the exact use case you want to achieve to see other ways to achieve it in SingleStore.

Hi Julian
Below is what SingleStore Supports

SELECT * FROM TABLE([1, 5, 10]);
+-----------+
| table_col |
+-----------+
|         1 |
|         5 |
|        10 |
+-----------+

We also have few other options MPSQL array to a set of row

Hi, I just signed up for this forum and i cannot find any way to create a topic. Maybe it’s because my permissions are limited?
However, I have a question regarding loading data from parquet files into singlestore:
Is there a way to automatically map every column by name without specifying it. When using CSV you don’t need to specify any columns when loading data into singlestore. But it seems like you need to do it when loading from parquet files?
Let’s say I want to load a file into a table, but I don’t want to specify every single column name and singlestore should handle it by itself. Is this possible?

I cannot find this use case in the documentation.

Thank you

An example of loading parquet files into singlestore can be found here:

Hi ,
I am struggling to find any documentation on sqlHelper class. I am trying to run a delete query using pyspark using executeSinglestoreQuery method but i am not able to do so as i am getting the spark session has no such attributes error even though i am using the right jars and am able to read/load the data

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?