Skip to content

slice_sample() throwing error on a MariaDB database #617

@josswright

Description

@josswright

I've recently had to pull a random sample of a fairly large (>1.5M row) database that's stored in a MariaDB instance. I wrote a fairly basic dbplyr filter:

# pseudocode: <set up database connection>
# pseudocode: db_tbl <- tbl( <connection>, "tablename" )

all_articles <-   
   db_tbl %>%
   slice_sample( n=5000 ) %>%
   collect 

I receive:

Error: FUNCTION tablename.random does not exist [1305]

I assume that this may be a limitation in functions internally provided by MariaDB, but I'm also unsure from searching around whether this is something I can fix (by implementing tablename.random directly on the DB side?) or if I'm just missing something obvious.

As an aside, I'm in a lucky position here where we're about to move this whole dataset and collection across to a new system, so I have the option to move database servers. Is there a recommended database implementation that's most compatible for dbplyr?

Metadata

Metadata

Assignees

No one assigned

    Labels

    reprexneeds a minimal reproducible example

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions