Skip to content

Commit f5290a7

Browse files
authored
resolves #1346 (#1347)
1 parent 156cd63 commit f5290a7

File tree

5 files changed

+961
-0
lines changed

5 files changed

+961
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# mrrun - Utility for MR query debugging
2+
3+
`mrrun` is a utility designed for local debugging of MapReduce queries. It allows you to execute YQL programs which involve creation of YT transactions.
4+
5+
## Command-Line Options
6+
7+
- `-p <file>`: _(required)_ specify a file with an SQL query or an s-expression (`-` for /dev/stdin).
8+
- `-s`: if specified, SQL is used; if not specified, the query plan execution specified in s-expression is used.
9+
- `-f <alias>@<path>`: attach a local file to the query
10+
- `--mrjob-bin <path>`: specify the path of mrjob binary to upload (the mrrun itself is used by default)
11+
12+
## Example of Local Usage
13+
14+
```bash
15+
mrrun -s -p query.sql -f file.txt@./some-file.txt
16+
```
17+
18+
In this example, `mrrun` will use SQL from the file `query.sql`, with file `./some-file.txt` attached to the request with alias `file.txt`.
19+
20+
The simple example of `query.sql`:
21+
22+
```sql
23+
USE `hahn`;
24+
25+
SELECT Length(name) FROM `home/yql/tutorial/users`;
26+
SELECT FileContent('file.txt');
27+
```
28+
## mrjob binary
29+
30+
Note that default mrjob binary (mrrun itself) has size of ~2GB, so it will take a long time to upload it to YT.
31+
It is recommended to compile mrjob separately and strip it (final size is about 200MB), then pass it to the dedicated command-line parameter.
32+
```bash``
33+
mrrun -s -p query.sql --mrjob-bin ./ydb/library/yql/tools/mrjob/mrjob
34+
```

0 commit comments

Comments
 (0)