admin - admin

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 31 total)
  • Author
    Posts
  • in reply to: Warning color for production critical servers #111949

    admin
    Keymaster
    in reply to: Server Search Keyboard shortcut? #111947

    admin
    Keymaster

    Press Control + R to search servers on version 3.07
    https://www.timestored.com/qstudio/help/keyboard-shortcuts#server-search

    in reply to: How to find which compression a column is using? #111945

    admin
    Keymaster

    pragma_storage_info(‘tablename’) returns meta data on the compression for a selected table. e.g.


    PIVOT (SELECT row_group_id, column_name, column_id, segment_type,compression,sum(count) AS c
    FROM pragma_storage_info('stocks') WHERE segment_type != 'VALIDITY' GROUP BY ALL)
    ON compression USING sum(c) AS c GROUP BY column_name,segment_type ORDER BY column_name,segment_type;

    Will pivot the compression etc. out to allow easier viewing like so:

    column_name	segment_type	ALP_c	BitPacking_c	Dictionary_c
    close	DOUBLE	34182458		
    date	DATE		34182458	
    high	DOUBLE	34182458		
    low	DOUBLE	34182458		
    open	DOUBLE	34182458		
    pre	VARCHAR			34182458
    sym	VARCHAR			34182458
    volume	BIGINT		34182458	
    
    in reply to: How do I update the JDBC driver? #111796

    admin
    Keymaster

    Both qStudio and Pulse dynamically download drivers on first use.

    The locations they store drivers are:
    C:\Users\{windows-username}\pulse\libs
    C:\Users\{windows-username}\qstudio\libs
    ./lib

    Notice that last ./lib is the current directory that you are running pulse from.

    If you have used clickhouse or dolphindb, they should already contain files named:
    clickhouse-jdbc-0.4.6.jar
    jdbc-1.30.22.5-jar-with-dependencies.jar

    To use new versions, you can delete and replace those files with any newer version from a maven repository.
    For example from here https://mvnrepository.com/artifact/com.clickhouse/clickhouse-jdbc/0.6.0 the files section has a link to .jar file:
    https://repo1.maven.org/maven2/com/clickhouse/clickhouse-jdbc/0.6.0/clickhouse-jdbc-0.6.0.jar

    Then restart the application to pick up the new drivers.

    We will update the drivers within Pulse and qStudio regularly but it requires manual testing and we won’t be doing this quickly for every version of all 30+ databases we support. So I hope this helps.

    in reply to: Where does Pulse store data? #111745

    admin
    Keymaster

    Pulse stores all dashboards, database connection details etc. to one single database file pulsedb.mv.db.

    • Usually with a .zip install or running on linux/mac the file is called pulsedb.mv.db and in the current directory where you run Pulse.
    • On a windows installation, Pulse is installed to C:\Program Files\pulse as is best practice on windows installs, Pulse saves the database to: C:\Users\{{current-username}}\pulse so that each user can have their own settings.

    Note sometimes you will see both a pulsedb.trace.db and pulsedb.mv.db file. pulsedb.trace.db is a temporary file written to when Pulse is running to allow faster database operations.

    I can’t think of many scenarios where Pulse would save then lose data and it hasn’t been reported by other users.

    Perhaps the original pulse.mv.db was created with different user permissions? e.g. You installed and first ran as root and now are trying to run as a limited user?

    Or you ran Pulse from a different current directory? Thereby creating different configurations?

    Related articles:

    in reply to: Allow user to choose kdb+ pivots from UI? #111734

    admin
    Keymaster

    Hi Quantific,

    Let’s assume you have the kdb+ pivot code (https://stackoverflow.com/questions/30789471/pivot-table-in-kdb-q) and that:
    trades_agg:1000#0!trades_agg
    Then providing a UI to select columns is simple.

    Example video: https://youtu.be/GyTQqKmymSU

    Steps:

    1. Add table trades_agg
    2. Add a Multi-select component with sql query: ([] c:cols trades_agg)
    3. Add a Multi-select component with sql query: ([] c:cols trades_agg)
    4. Add a Dropdown select component with sql query: ([] c:cols trades_agg)
    5. Add another table with the query: piv[trades_agg;(),<code>${{key1}}; (),${{key2}}; (),`${{key3}}]

    i.e. You want three variables, then to place those 3 variables into the piv function while making sure they are lists of symbols.

    kdb+ Pivot

    // see https://stackoverflow.com/questions/30789471/pivot-table-in-kdb-q
    // I then aggregate the data into equal sized buckets

    in reply to: string functions? like search replace regex? #111315

    admin
    Keymaster

    We’ve added a full listing of string functions here:
    http://www.timestored.com/kdb-guides/kdb-string-functions

    in reply to: q unit testing #427

    admin
    Keymaster

    Testing frameworks for kdb+ include:

    1. qunit – unit testing similar to junit etc with asserts and integrates well with qStudio
    2. k4unit – unit testing driven from a csv file
    3. qspec – spec testing framework for kdb+
    in reply to: SQL case statement #352

    admin
    Keymaster

    Kdb doesn’t have a “case when then else”, it has something similar called vector conditional.
    This link gives details: http://www.timestored.com/kdb-guides/q-quirks#caseStatement

    Basically standard SQL:
    `SELECT
    CASE
    WHEN Date1 >= Date2 THEN Date1
    ELSE Date2
    END AS MostRecentDate`

    Kdb Code:

    `q)update mostRecentDate:?[date1>=date2;date1;date2] from t
    date1 date2 mostRecentDate
    ————————————
    2001.08.05 2007.09.28 2007.09.28
    2011.05.21 2007.07.25 2011.05.21
    2005.08.10 2008.07.06 2008.07.06
    2003.02.16 2008.10.11 2008.10.11
    2007.10.05 2004.03.01 2007.10.05`

    The vector conditional takes three args ?[a;b;c]
    a is a list of booleans
    b and c are a list of same typed values
    where a was true, the value is taken from b, otherwise it’s taken from c.

    in reply to: Get todays date time in kdb #351

    admin
    Keymaster

    The .z namespace contains functions for accessing the current data and time. e.g.

    q).z.t
    09:56:06.145
    q).z.d
    2013.05.21

    The pattern is .z.{letter of data type wanted}

    q)value each {x!x}`.z.p`.z.P`.z.t`.z.T`.z.d`.z.D`.z.n`.z.z`.z.Z
    .z.p| 2013.05.21D09:56:06.145203000
    .z.P| 2013.05.21D10:56:06.145203000
    .z.t| 09:56:06.145
    .z.T| 10:56:06.145
    .z.d| 2013.05.21
    .z.D| 2013.05.21
    .z.n| 0D09:56:06.145203000
    .z.z| 2013.05.21T09:56:06.145
    .z.Z| 2013.05.21T10:56:06.145

    in reply to: get environment variable #217

    admin
    Keymaster

    getenv

    getenv `LOG_DIR

    q)getenv `PATH
    "C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Windows\\syst..

    in reply to: timeout for long qsql queries #214

    admin
    Keymaster

    From the console you can use ctrl+c to break during a long running command:
    http://www.timestored.com/kdb-guides/debugging-kdb#interrupt-q
    Make sure to exit debug mode so the server answers client queries.

    in reply to: qsql select first last by group #213

    admin
    Keymaster

    We have added some notes on creating functional select that you may find useful:
    http://www.timestored.com/kdb-guides/functional-queries-dynamic-sql

    in reply to: printf formatting date time floats #212

    admin
    Keymaster

    You could import printf like functionality using a C shared library (windows DLL, Linuz .so)

    in reply to: timeout for long qsql queries #209

    admin
    Keymaster

    If you start kdb with the argument -T:

    q -T 10

    This will set a timeout on client queries of 10 seconds. Note not all queries are polite enough to stop when requested and I think commands at the console may ignore this setting.

    You should also be able to modify this setting using
    \T (seconds)
    from within kdb.

Viewing 15 posts - 1 through 15 (of 31 total)