shlogg · Early preview
Judy @esproc_spl

Like open source, follow open source

Mongodb Group Summation With Window Functions

MongoDB aggregation pipeline groups data by GRP, sorts by seq within group, sums score fields, and writes sum into x field in last row of each group.

Grouping Adjacent States In MongoDB With Aggregation Pipeline

MongoDB Aggregation Pipeline groups adjacent states by combining sort, group, project, unwind, and group stages.

Efficiently Finding Supersets In MySQL Vs SPL

MySQL database has tables for bags & item relationships. Finding supersets requires complex SQL queries with JOINs & EXISTS. SPL simplifies this using 2-layer loops & intuitive set operations.

SQL Vs SPL: Efficient Grouping And Interval Search In Database Queries

SPL simplifies SQL complexity for grouped subsets & positional references. Use `GROUP BY` without aggregation, then search within a 3-record interval (`[-1:1]`) for specified `Cardboard_Number`.

SQL Vs SPL: Ordered Grouping In Database Tables

Database table describes payment cycles for multiple projects with regular & closing months. SQL uses window functions to identify payment months & calculate total amounts, but SPL offers a more straightforward approach.

Associating Invoices With Projects: SQL Vs SPL

SQL Server database requires indirect implementation using nested subqueries & window functions to associate tables & add SplitAmount field according to rules. SPL code can be more natural with grouped subsets.

Calculating 24 With Four Cards: SPL Code Solution

Write code to calculate 24 from 4 cards using SPL. Enumerate permutations & operator combinations. Use eval to calculate expressions with different operation orders.

Big Data Performance: Beyond Slogans And Benchmarks

Big data products' performance claims often exaggerated. "Queries over trillion-row tables in seconds" means using indexes for target-search tasks, not full traversal. Efficient algorithms & resources key to performance, not just big data handling.

Implementing Handwritten Number Recognition From Scratch With EsProc

Recognizing handwritten Arabic numbers simplified with machine learning. Implemented from scratch without third-party libraries using esProc, achieving 91.1% accuracy in just over 10 lines of code.

SPL Database Management System For Enhanced Performance

SPL (Structured Programming Language) boasts table sequences, ordered computing & flow processing for efficient data manipulation & complex computations. Interpreted code & stored procedures reduce maintenance costs & system coupling.

SQL Vs SPL: Simplifying Complex Grouping With Sequence Numbers

SQL solution fails due to cumbersome window functions & lack of natural sequence numbers. SPL retains grouped subsets, provides natural seq nums & direct referencing, making complex multi-step calculations easier.

SPL Vs Relational Algebra: Performance Advantages And Benefits

SPL outperforms SQL in aggregation, filtering, grouping & joining with 2000+ times speedup in group insurance queries & 100-concurrency self-service analysis

SPL: A Simpler Alternative To SQL For Complex Business Logic

SPL outshines SQL with its set-oriented design, discreteness & orderliness, making it easier to write efficient & readable code for complex business logic.

SQL Vs SPL: Simplifying Data Processing With Natural Sequence Numbers

SQL solution is cumbersome, SPL provides natural sequence numbers & position related calculations, making data processing easier.

SQL Limitations Vs SPL Advantages In Data Analysis

SPL outshines SQL in data analysis with simpler syntax, efficient execution & powerful debugging tools. Say goodbye to complex code & hello to faster query times!

SQL Vs SPL: Simplifying Monthly Balance Calculations

SQL solution for calculating asset balances: `WITH Accounts AS (SELECT DISTINCT Name FROM trans), Months AS (SELECT DATEADD(MONTH, n, '2021-01-01') AS MonthStart ...

Recursive Node Hierarchy Extraction In SPL Vs SQL

SQL solution for multi-level self-association structure: use recursive CTEs to find hierarchy and zones. SPL provides direct functions for recursive references.

Converting PostgreSQL Rows To Columns With SPL Pivot Function

Pivot data from rows to columns using SPL: Query Postgresql, use pivot function with grouping column & Key column, convert values to new column names & values.

Oracle Database Query With Multiple String Parameters

Need to find Oracle database records matching multiple strings in fields. Use JDBC, split param by spaces & filter records with superset match.

Generating Sequence Numbers In MS SQL With SPL Code

Need to add sequence number column "Seq" to MS SQL table: increment by 1 for same account within 1hr, reset to 1 after 1hr

Splitting Comma Separated Strings In MS SQL With SPL

Split MS SQL comma-separated string into 5 fields using SPL: A1) Query DB, A2) Split items field, A3) Create new table with Srllno1-Srllno5 fields.

Adding Session ID Column In Big Query With SPL Code

Added "session id" column in Big Query: set first event as checkpoint, increment ID if > 7 days since last event. SPL code provided.

Get Students With Highest Average Score Using MongoDB & EsProc SPL

Computing highest average score in MongoDB: unwind Scores, group by StudentID, calculate avg_score, sort & get top records. esProc SPL also simplifies this task with a single script.

Extracting XML Data With EsProc: A Step-by-Step Guide

Extracting data from XML file: Read xml.xml as string, use xml function to get form layer data & export to 2D table in result.txt using esProc script p1.dfx.

Converting Multilevel JSON To 2D CSV With EsProc

Converting multilevel JSON to 2D CSV: use esProc script p1.dfx to split & promote identities fields, export as json.csv. See SPL source & integration guide.

Sorting CSV Data With EsProc: A Step-by-Step Guide

Sorting CSV data by unique index: Read csv.csv, sort by upc14 column, export to result.txt using esProc script p1.dfx.

Cross-Database Join Query Using JDBC And EsProc

Cross-database join query using JDBC: Connect MySQL_A & B, read employee & family tables, join through EID, get RELATION between ENAME & FNAME.

Finding Missing Records In Time Series Data With EsProc

Missing records found by comparing expected & actual data. Script p1.dfx calculates differences using esProc, integrating with Java for missing record detection.

Converting SQL Queries For MySQL With EsProc

Need to execute SQL with WEEKOFYEAR function in MySQL without rewriting. Use esProc script p1.dfx to translate and query database, then close connection.

Ranking Top 2 Students With SPL Script

Scores table used to find top 2 students with highest scores. SPL script connects to database, queries student scores and returns top 2 rankings.

Calculating User Sessions And Retention Rates With SQL Queries

Calculate user sessions: 10min inactivity or 5min logout. Count players scoring 3x in a row within 1min. Track daily active users & next-day retention rate of new users.

Joining MySQL & Oracle Tables With EsProc

Joining MySQL persons with Oracle orders tables using esProc script. Full join on id_p lists all desired data. Read more: Download esProc script and integrate with Java.

How To Concatenate Sales Data From Oracle And MySQL Using EsProc.

Concatenate sales data from Oracle (2013) and MySQL (2014) using esProc script p1.dfx. Translate SQL functions for specific databases and combine results. Read more on SPL open source address.

Splitting Huge CSV Files Into Smaller Chunks For Memory Efficiency

Split huge CSV file into smaller chunks using esProc script: Create cursor, loop through rows, export to sample[n].csv. Read 100000 rows at a time due to memory constraints.

How To Split Employee Records Into Two Tables Using EsProc And Java

Divide CSV records into two tables: EMP (newest employees) and EMP_HIS (historical records). Use esProc script p1.dfx to group by EMPID, get latest UPDATEDATE values, and update or insert records into database.

How To Repeat Rows In Txt File Based On Number M

We have a txt file with N+1 rows. Repeat row N M times and get an altogether N*M rows. Write a script in esProc to achieve this, then integrate it with a Java program using @i option for sequence return.

How To Merge Two Text Files Using EsProc And Java Integration

Merging two txt files through ID field using esProc: Import data1.txt (A1), data2.txt (A2). Join A1 & A2 on ID. Create result table sequence. Export to mergedFile.txt.

Converting Text Blocks Into Strings With EsProc

Problem: Convert text file blocks into strings. Solution: Use esProc script (p1.dfx) with @i import, A2 grouping & A3 export.

Removing Duplicate Rows From Sorted Text File With EsProc

Remove duplicates from sorted text file: write script p1.dfx in esProc, import data with @i option, perform distinct on ordered sequence & export result.

Finding Primary Key Value In SPL Script

Find member with ID 5: Connect to db (A1), retrieve Category table (A2) & set ID as PK. Use pfind() to find record with PK value 5.

Get Max Value Record With SPL Script And Maxp() Function

Get max record with SPL: Retrieve Olympic medal count table, sort by game & total medals desc, get 1st record per game, group by nation, find longest group.

Converting Categorized CSV Data To Multilevel Format In EsProc

Converting categorized CSV to multilevel data: import CSV, group by metric, convert to JSON using esProc script.

Replacing Duplicates With Underlines In Strings

Replacing duplicates: Here ____ ____ we go! So they're finally ____, performing for you. Script p1.dfx in esProc removes duplicate words with underlines.

Finding Minimum Math Score With SPL's Minp Function

Get min value record: Use minp() to find ID(s) of students with lowest math score in class 1. @a option returns all records with min value.

Error Handling In Text File Processing With EsProc

Text file analysis: handle null fields, empty rows & calculate sales. Script p1.dfx in esProc: loop through sequence, calculate Quantity * Unit Price, output errors or total sales.

Reversing Text File Rows With EsProc Script

Reverse row order in txt.txt: Write `esProc` script p1.dfx to reverse rows, outputting result to result.txt.

Calculating REP Differences With Sybase Limitations.

We have table SAMPLE in Sybase. Need to calculate REP difference between current & previous date for same SECURITY_ID. SQL solution complicated due to lack of window functions. esProc SPL makes it easy with direct support for ordered sets.

Extracting Stock Transaction Data With SPL Scripting

Get transaction info for Merchants Bank (600036) when closing price > 25 yuan in 2017 using SPL script.

Retrieving Class One Students With Math Scores 90+ In SPL

Find class one students with math score 90+ using SPL script: Connect to db, retrieve Scores table & get records where math score is 90 or above.

Retrieving Student Records With Scores 90+ Using SPL Script

Find student scores >= 90: A1 Connect to db; A2 Retrieve Scores table; A3 Get records where SCORE is 90 or above using select() with @1 option.

Ordinal Numbers In Scores Table: SCORE 90+ Records

Find ordinal numbers of student records with SCORE 90+ in Scores table using SPL script: A1 Connect to db; A2 Retrieve Scores table; A3 Get ordinal numbers where SCORE is 90 or above.

Split Large CSV File Into Smaller Files With SPL In Java

Split large CSV file into smaller files using Java: use SPL code to divide file into parts with ordinal numbers like Orders1.csv, each part <5M.

Handling NULL Values In PostgreSQL With SPL: Efficient Data Processing

Handle records with NULL column3 values: delete until first non-NULL appears, then modify each NULL value to its previous one. Repeat for new non-NULL values.

Compute Final Grade With Simplified SPL Formula In Java

Compute Final Grade using Lab Exercise * 30% + Long Quiz * 30% + Alternative Assessment * 40%. Use Java with T()function & derive() function for a new csv file.

Comparing CSV Files With SPL: 3 Ways To Find Differences

Here are two csv files (A and B) with same structure. Use Java to compare them in three ways: 1. Equal primary keys with different values. 2. Records existing only in A. 3. Records existing only in B. Write results to new csv files.

Reorganizing CSV With Carriage Returns In Java Using SPL

Reorganize csv file with Java using SPL script: import data.csv as 2D table, handle carriage returns & quotes, modify table with run() function.

Grouping Temp_data By Year And Letter, Counting Records

Group temp_data by year & LETTER, count records, align to cross product of year & letter; arrange years chronologically & letters by LETTER_SEQ.

Grouping PostgreSQL Tmp Table By Source_id And Event_date

Group PostgreSQL tmp table by source_id & sort by event_date. Add SERIES_ID to number sub-groups under each source_id using SPL code.

Retrieving Last Elevator Passengers With SPL SQL Code

Retrieve MSSQL data, sort by turn. Group by stop, reset cum weight > 1000kg. Get last record's name in each group.

Parsing Multilayer JSON Strings In BigQuery With SPL

Parsing BigQuery JSON strings in SPL: A1 runs SQL to retrieve JSON, A2 parses multilayer strings to extract values under "values.value" field.

List Flight Connections By Group With SPL Code

List flight connections for each group. Use SPL code to split ROUTE field by dash, remove duplicates & concatenate.

Extracting Medical History With SPL Code For SAS System

Retrieve data from SAS, sort by Visit_code & Date. Group by Id, create new table with Office_Visit=1 if consultation after surgery, SX_past_6mo=1 if 6 months later.

Calculating Median Values For Multiple Columns In PostgreSQL

In PostgreSQL, use SPL code: new() function & array() to find median of all column values in each row.

MSSQL Computed Column Flag For Duplicate Rows Detection

Create computed column Flag in MSSQL: group rows by Serial_Number, record "Y" for duplicate Last_update_date values, otherwise "N".

How To Insert Discontinuous Records Into OLDTABLE Based On RANK

Inserting records from NEWTABLE into OLDTABLE based on RANK values, ensuring continuity and updating ranks accordingly. Solution involves using esProc script p1.dfx to perform SQL queries and insertions.