refactor: standard naming (#278)

* refactor: rename flinksql to flink

* refactor: rename pgsql to postgresql

* refactor: rename trinosql to trino

* refactor: replace all default exports with named export

* refactor: rename basicParser to basicSQL

* refactor: rename basic-parser-types to types

* refactor: replace arrow func with plain func
This commit is contained in:
Hayden
2024-03-27 10:33:25 +08:00
committed by GitHub
parent a99721162b
commit bb0fad1dbe
325 changed files with 33161 additions and 33202 deletions

View File

@ -0,0 +1,12 @@
# FlinkSQL Benchmark
| Name | Rows | Times | Total Time(ms) | Average Time(ms) |
| ---- | ---- | ---- | ---- | ---- |
| CreateTable | 100 | 1 | 150.34 | 150.34 |
| CreateTable | 1000 | 1 | 53.04 | 53.04 |
| CreateTable | 5000 | 1 | 179.04 | 179.04 |
| SelectTable | 100 | 1 | 460.25 | 460.25 |
| SelectTable | 1000 | 1 | 46.24 | 46.24 |
| SelectTable | 5000 | 1 | 505.28 | 505.28 |
| InsertTable | 100 | 1 | 13.58 | 13.58 |
| InsertTable | 1000 | 1 | 33.07 | 33.07 |
| InsertTable | 5000 | 1 | 242.58 | 242.58 |

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,105 @@
import { FlinkSQL } from 'src/parser/flink';
import {
readSQL,
benchmark,
getReportTableHeader,
getReportTableRow,
exportReportTable,
} from 'test/helper';
const features = {
selectTable: readSQL(__dirname, 'selectTable.sql'),
createTable: readSQL(__dirname, 'createTable.sql'),
insertTable: readSQL(__dirname, 'insertTable.sql'),
};
describe('FlinkSQL benchmark tests', () => {
const flink = new FlinkSQL();
let reportsHeader = getReportTableHeader('FlinkSQL Benchmark');
const reportData: string[] = [];
test('createTable Over 100 Rows', async () => {
const [totalTimes, averageTimes, msg] = benchmark('CreateTable Over 100 Rows', () => {
const testSQL = features.createTable[0];
const res = flink.validate(testSQL);
expect(res).toEqual([]);
});
reportData.push(getReportTableRow('CreateTable', 100, 1, totalTimes, averageTimes));
});
test('createTable Over 1000 Rows', async () => {
const [totalTimes, averageTimes, msg] = benchmark('CreateTable Over 1000 Rows', () => {
const testSQL = features.createTable[1];
const res = flink.validate(testSQL);
expect(res).toEqual([]);
});
reportData.push(getReportTableRow('CreateTable', 1000, 1, totalTimes, averageTimes));
});
test('createTable Over 5000 Rows', async () => {
const [totalTimes, averageTimes, msg] = benchmark('CreateTable Over 5000 Rows', () => {
const testSQL = features.createTable[2];
const res = flink.validate(testSQL);
expect(res).toEqual([]);
});
reportData.push(getReportTableRow('CreateTable', 5000, 1, totalTimes, averageTimes));
});
test('selectTable Over 100 Rows', async () => {
const [totalTimes, averageTimes, msg] = benchmark('SelectTable Over 100 Rows', () => {
const testSQL = features.selectTable[0];
const res = flink.validate(testSQL);
expect(res).toEqual([]);
});
reportData.push(getReportTableRow('SelectTable', 100, 1, totalTimes, averageTimes));
});
test('selectTable Over 1000 Rows', async () => {
const [totalTimes, averageTimes, msg] = benchmark('SelectTable Over 1000 Rows', () => {
const testSQL = features.selectTable[1];
const res = flink.validate(testSQL);
expect(res).toEqual([]);
});
reportData.push(getReportTableRow('SelectTable', 1000, 1, totalTimes, averageTimes));
});
test('selectTable Over 5000 Rows', async () => {
const [totalTimes, averageTimes, msg] = benchmark('SelectTable Over 5000 Rows', () => {
const testSQL = features.selectTable[2];
const res = flink.validate(testSQL);
expect(res).toEqual([]);
});
reportData.push(getReportTableRow('SelectTable', 5000, 1, totalTimes, averageTimes));
});
test('insertTable Over 100 Rows', async () => {
const [totalTimes, averageTimes, msg] = benchmark('InsertTable Over 100 Rows', () => {
const testSQL = features.insertTable[0];
const res = flink.validate(testSQL);
expect(res).toEqual([]);
});
reportData.push(getReportTableRow('InsertTable', 100, 1, totalTimes, averageTimes));
});
test('insertTable Over 1000 Rows', async () => {
const [totalTimes, averageTimes, msg] = benchmark('InsertTable Over 1000 Rows', () => {
const testSQL = features.insertTable[1];
const res = flink.validate(testSQL);
expect(res).toEqual([]);
});
reportData.push(getReportTableRow('InsertTable', 1000, 1, totalTimes, averageTimes));
});
test('insertTable Over 5000 Rows', async () => {
const [totalTimes, averageTimes, msg] = benchmark('InsertTable Over 5000 Rows', () => {
const testSQL = features.insertTable[2];
const res = flink.validate(testSQL);
expect(res).toEqual([]);
});
reportData.push(getReportTableRow('InsertTable', 5000, 1, totalTimes, averageTimes));
});
afterAll(() => {
exportReportTable(reportsHeader + reportData.join('\n'), __dirname);
});
});