Results of 1 - 10 of about 20 for random (0.007 sec.)
- Relational API – DuckDB 13577
- This page is for DuckDB 1.3, which is outdated. Switch to the current version . Search Shortcut cmd + k | ctrl + k Installation Documentation Getting Started Connect Overview Concurrency Data Import Overview Data Sources CSV Files Overview
...name of the current alias Example import duckdb duckdb_conn = duckdb . connect () rel = duckdb_conn . sql ( """ select gen_random_uuid() as id, concat('value is ', case when mod(range,2)=0 then 'even' else 'uneven' end) as description, range as value,...columns of the relation. Example import duckdb duckdb_conn = duckdb . connect () rel = duckdb_conn . sql ( """ select gen_random_uuid() as id, concat('value is ', case when mod(range,2)=0 then 'even' else 'uneven' end) as description, range as value,...h column of the relation. Example import duckdb duckdb_conn = duckdb . connect () rel = duckdb_conn . sql ( """ select gen_random_uuid() as id, concat('value is ', case when mod(range,2)=0 then 'even' else 'uneven' end) as description, range as value,... - https://man.mtool.work/duckdb/1.3/clients/python/relational_api.html
- Create Synthetic Data – DuckDB 12388
- This page is for DuckDB 1.3, which is outdated. Switch to the current version . Search Shortcut cmd + k | ctrl + k Installation Documentation Getting Started Connect Overview Concurrency Data Import Overview Data Sources CSV Files Overview
...ts (Cartesian products) For example: import duckdb from duckdb.typing import * from faker import Faker fake = Faker () def random_date (): return fake . date_between () def random_short_text (): return fake . text ( max_nb_chars = 20 ) def random_long_...text (): return fake . text ( max_nb_chars = 200 ) con = duckdb . connect () con . create_function ( "random_date" , random_date , [], DATE , type = "native" , side_effects = True ) con . create_function ( "random_short_text" , ran...dom_short_text , [], VARCHAR , type = "native" , side_effects = True ) con . create_function ( "random_long_text" , random_long_text , [], VARCHAR , type = "native" , side_effects = True ) res = con . sql ( """ SELECT hash(i... - https://man.mtool.work/duckdb/1.3/guides/snippets/create_synthetic_data.html
- Utility Functions – DuckDB 9754
- This page is for DuckDB 1.3, which is outdated. Switch to the current version . Search Shortcut cmd + k | ctrl + k Installation Documentation Getting Started Connect Overview Concurrency Data Import Overview Data Sources CSV Files Overview
...asing results. force_checkpoint(database) Synchronize WAL with file for (optional) database interrupting transactions. gen_random_uuid() Return a random UUID similar to this: eeccb8c5-9943-b2bb-bb5e-222f4e14b687 . getenv(var) Returns the value of the e...ot have one already. typeof(expression) Returns the name of the data type of the result of the expression. uuid() Return a random UUID (UUIDv4) similar to this: eeccb8c5-9943-b2bb-bb5e-222f4e14b687 . uuidv4() Return a random UUID (UUIDv4) similar to th...is: eeccb8c5-9943-b2bb-bb5e-222f4e14b687 . uuidv7() Return a random UUIDv7 similar to this: 81964ebe-00b1-7e1d-b0f9-43c29b6fb8f5 . uuid_extract_timestamp(uuidv7) Extracts timestamp from a UU... - https://man.mtool.work/duckdb/1.3/sql/functions/utility.html
- Python Function API – DuckDB 9244
- This page is for DuckDB 1.3, which is outdated. Switch to the current version . Search Shortcut cmd + k | ctrl + k Installation Documentation Getting Started Connect Overview Concurrency Data Import Overview Data Sources CSV Files Overview
...function that calls a third-party library. import duckdb from duckdb.typing import * from faker import Faker def generate_random_name (): fake = Faker () return fake . name () duckdb . create_function ( "random_name" , generate_random_name , [], VARCH...AR ) res = duckdb . sql ( "SELECT random_name()" ). fetchall () print ( res ) [('Gerald Ashley',)] Creating Functions To register a Python UDF, use the create_func...nctions are expected to produce the same result for the same input. If the result of a function is impacted by any type of randomness, side_effects must be set to True . To unregister a UDF, you can call the remove_function method with the UDF name: co... - https://man.mtool.work/duckdb/1.3/clients/python/function.html
- Interval Type – DuckDB 9006
- This page is for DuckDB 1.3, which is outdated. Switch to the current version . Search Shortcut cmd + k | ctrl + k Installation Documentation Getting Started Connect Overview Concurrency Data Import Overview Data Sources CSV Files Overview
...ler of these three basis units. SELECT INTERVAL 1 YEAR , -- single unit using YEAR keyword; stored as 12 months INTERVAL ( random () * 10 ) YEAR , -- parentheses necessary for variable amounts; -- stored as integer number of months INTERVAL '1 month 1...s not split into additional units. To demonstrate this, the following query generates an INTERVAL called period by summing random amounts of the three basis units. It then extracts the aforementioned six parts from period , adds them back together, and...month' , 'day' , 'hour' , 'minute' , 'microsecond' ] ], ( i1 , i2 ) -> i1 + i2 ) -- always true FROM ( VALUES ( INTERVAL ( random () * 123_456_789_123 ) MICROSECONDS + INTERVAL ( random () * 12_345 ) DAYS + INTERVAL ( random () * 12_345 ) MONTHS ) ) _... - https://man.mtool.work/duckdb/1.3/sql/data_types/interval.html
- Numeric Functions – DuckDB 8938
- This page is for DuckDB 1.3, which is outdated. Switch to the current version . Search Shortcut cmd + k | ctrl + k Installation Documentation Getting Started Connect Overview Concurrency Data Import Overview Data Sources CSV Files Overview
...es x to the power of y . power(x, y) Alias of pow . Computes x to the power of y . radians(x) Converts degrees to radians. random() Returns a random number x in the range 0.0 <= x < 1.0 . round_even(v NUMERIC, s INTEGER) Alias of roundbankers(v, s) . R...und(v NUMERIC, s INTEGER) Round to s decimal places. Values s < 0 are allowed. setseed(x) Sets the seed to be used for the random function. sign(x) Returns the sign of x as -1, 0 or 1. signbit(x) Returns whether the signbit is set or not. sin(x) Comput...ple power(2, 3) Result 8 radians(x) Description Converts degrees to radians. Example radians(90) Result 1.5707963267948966 random() Description Returns a random number x in the range 0.0 <= x < 1.0 . Example random() Result various round_even(v NUMERIC... - https://man.mtool.work/duckdb/1.3/sql/functions/numeric.html
- Multiple Python Threads – DuckDB 8870
- This page is for DuckDB 1.3, which is outdated. Switch to the current version . Search Shortcut cmd + k | ctrl + k Installation Documentation Getting Started Connect Overview Concurrency Data Import Overview Data Sources CSV Files Overview
...hen that insert occurred using the DEFAULT expression . import duckdb from threading import Thread , current_thread import random duckdb_con = duckdb . connect ( 'my_peristent_db.duckdb' ) # Use connect without parameters for an in-memory database # du...ill be created. Then, create first writer and then reader threads. Next, shuffle them so that they will be kicked off in a random order to simulate simultaneous writers and readers. Note that the threads have not yet been executed, only defined. write_...args = ( duckdb_con ,), name = 'read_thread_' + str ( j ))) # Shuffle the threads to simulate a mix of readers and writers random . seed ( 6 ) # Set the seed to ensure consistent results when testing random . shuffle ( threads ) Run Threads and Show Re... - https://man.mtool.work/duckdb/1.3/guides/python/multiple_threads.html
- marimo Notebooks – DuckDB 8819
- This page is for DuckDB 1.3, which is outdated. Switch to the current version . Search Shortcut cmd + k | ctrl + k Installation Documentation Getting Started Connect Overview Concurrency Data Import Overview Data Sources CSV Files Overview
...ld be re-run. digits = mo . ui . slider ( label = "Digits" , start = 100 , stop = 10000 , step = 200 ) digits CREATE TABLE random_data AS SELECT i AS id , random () AS random_value , FROM range ({ digits.value }) AS t ( i ); SELECT * FROM random_data ;...関連キーワード marimo DuckDB cell connection cells notebook queries notebooks automatically code tutorial duckdb Reference random letting makes scripts install polars Create using column values elements create 関連するページ Jupyter Notebooks Python AP... - https://man.mtool.work/duckdb/1.3/guides/python/marimo.html
- Loops – DuckDB 7800
- This page is for DuckDB 1.3, which is outdated. Switch to the current version . Search Shortcut cmd + k | ctrl + k Installation Documentation Getting Started Connect Overview Concurrency Data Import Overview Data Sources CSV Files Overview
...ith clever use of cross products and other expressions, many different types of datasets can be efficiently generated. The random() function can also be used to generate random data. An alternative option is to read data from an existing CSV or Parquet... - https://man.mtool.work/duckdb/1.3/dev/sqllogictest/loops.html
- R-Tree Indexes – DuckDB 7562
- This page is for DuckDB 1.3, which is outdated. Switch to the current version . Search Shortcut cmd + k | ctrl + k Installation Documentation Getting Started Connect Overview Concurrency Data Import Overview Data Sources CSV Files Overview
...ed when the table is filtered with a spatial predicate: INSTALL spatial ; LOAD spatial ; -- Create a table with 10_000_000 random points CREATE TABLE t1 AS SELECT point :: GEOMETRY AS geom FROM st_generatepoints ({ min_x : 0 , min_y : 0 , max_x : 100 ,...w_id ROW_TYPE If this is a leaf node, the rowid of the row in the table, otherwise NULL Example: -- Create a table with 64 random points CREATE TABLE t1 AS SELECT point :: GEOMETRY AS geom FROM st_generatepoints ({ min_x : 0 , min_y : 0 , max_x : 100 ,... - https://man.mtool.work/duckdb/1.3/core_extensions/spatial/r-tree_indexes.html
DuckDB 1.3 Documentation / man.mtool.work