Skip to content

Commit

Permalink
[examples] updated README.md for basic-python-example
Browse files Browse the repository at this point in the history
Change-Id: I103dde66b69db17099b94d66777df37abb4f9fa8
Reviewed-on: http://gerrit.cloudera.org:8080/12458
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <[email protected]>
  • Loading branch information
alexeyserbin committed Feb 20, 2019
1 parent 3e3bd1c commit 083ab13
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
22 changes: 15 additions & 7 deletions examples/python/basic-python-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,33 @@ See the License for the specific language governing permissions and
limitations under the License.
-->

# Basic Kudu-Python Example
# Basic Kudu-Python example
This is a very basic example of usage for the Kudu Python client.
It demonstrates much of the standard capabilities within the client.

## To install the Python client

### Building from source
_NOTE:_ This example is pointing to the latest build, which is often
times a debug build. If this is not the desired approach, you will
need to point this to the release build.
It's assumed the commands below are run from the directory where
this README.md file is located, i.e. from
`$KUDU_HOME/examples/python/basic-python-example`.

_NOTE:_ This example assumes that all Kudu C++ components are already
built in `$KUDU_HOME/build/latest`. That directory is pointing to the
latest build, which is often times a debug build. If this is not the
desired approach, you will need to point the `latest` symbolic link
to the release build Kudu directory.

```
export KUDU_HOME=/path/to/kudu
export LD_LIBRARY_PATH=$KUDU_HOME/build/latest/lib/exported
# For OS X
export DYLD_LIBRARY_PATH=$KUDU_HOME/build/latest/lib/exported
pushd $KUDU_HOME/python
pip install -r requirements.txt
python setup.py build_ext --inplace
python setup.py install
popd
```

### Installing from pypi
Expand All @@ -45,7 +54,6 @@ pip install kudu-python
```

## Running the example

```
./basic_example.py --masters master1.address --ports 7051
```
python basic_example.py --masters master1.address --ports 7051
```
2 changes: 1 addition & 1 deletion examples/python/basic-python-example/basic_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,5 @@

# Open scanner and print all tuples.
# Note: This doesn't scale for large scans
# Output: [(1, datetime.datetime(2017, 1, 1, 0, 0, tzinfo=<UTC>))]
# The expected output: [(1, datetime.datetime(2017, 1, 1, 0, 0, tzinfo=<UTC>))]
print(scanner.open().read_all_tuples())

0 comments on commit 083ab13

Please sign in to comment.